Find an N | C # program for the above approach ; 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
using System ; using System . Collections . Generic ; class GFG { static void printBinaryString ( int [ , ] arr , int N ) { for ( int i = 1 ; i <= N ; i ++ ) { if ( i % 2 == 1 ) { Console . Write ( 0 ) ; } else { Console . Write ( 1 ) ; } } } public static void Main ( ) { int N = 5 ; int [ , ] arr = { { 1 , 3 } , { 2 , 4 } , { 2 , 5 } } ; printBinaryString ( arr , N ) ; } }