Driver Code
int main ( ) { int arr [ ] = { 2 , 7 , 1 , 4 } ; int n = sizeof ( arr ) / sizeof ( arr [ 0 ] ) ; int K = 7 ; vector < vector < int > > v = maxSubArray ( arr , n , K ) ; cout << " [ " ; bool first = true ; for ( auto x : v ) { if ( ! first ) { cout << " , ▁ " ; } else { first = false ; } cout << " [ " ; bool ff = true ; for ( int y : x ) { if ( ! ff ) { cout << " , ▁ " ; } else { ff = false ; } cout << y ; } cout << " ] " ; } cout << " ] " ; return 0 ; }