Modify a Binary String by flipping characters such that any pair of indices consisting of 1 s are neither co | Function to modify a string such that there doesn 't exist any pair  of indices consisting of 1s, whose  GCD is 1 and are divisible by each other ; Flips characters at indices 4 N , 4 N - 2 , 4 N - 4 . ... upto N terms ; Print the string ; Driver code ; Initialize the string S ; function call
function findString ( S , N ) { var strLen = 4 * N ; for ( var i = 1 ; i <= N ; i ++ ) { S [ strLen - 1 ] = " " ; strLen -= 2 ; } for ( var i = 0 ; i < 4 * N ; i ++ ) { document . write ( S [ i ] ) ; } } var N = 2 ; var S = [ ... Array ( 4 * N ) ] ; for ( var i = 0 ; i < 4 * N ; i ++ ) S [ i ] = " " ; findString ( S , N ) ;