Find an N | Function to find an N - length binary string having maximum sum of elements from all given ranges ; Iterate over the range [ 1 , N ] ; If i is odd , then print 0 ; Otherwise , print 1 ; Driver Code ; Function Call
def printBinaryString ( arr , N ) : NEW_LINE INDENT for i in range ( 1 , N + 1 ) : NEW_LINE INDENT if ( i % 2 ) : NEW_LINE INDENT print ( 0 , end = " " ) ; NEW_LINE DEDENT else : NEW_LINE INDENT print ( 1 , end = " " ) ; NEW_LINE DEDENT DEDENT DEDENT N = 5 ; NEW_LINE M = 3 ; NEW_LINE arr = [ [ 1 , 3 ] , [ 2 , 4 ] , [ 2 , 5 ] ] ; NEW_LINE printBinaryString ( arr , N ) ; NEW_LINE