Driver Code
public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 7 , 1 , 4 } ; int K = 7 ; List < List < int > > list = maxSubArray ( arr , K ) ; foreach ( List < int > i in list ) { Console . Write ( " [ " ) ; foreach ( int j in i ) { Console . Write ( j ) ; if ( i . Count > 1 ) Console . Write ( " , " ) ; } Console . Write ( " ] " ) ; } } }