Driver code
int main ( ) { int arr1 [ ] = { 2 , -4 , 5 , 3 } ; int arr2 [ ] = { 0 , 1 , 0 , 1 } ; int n = sizeof ( arr1 ) / sizeof ( arr1 [ 0 ] ) ; cout << maxSum ( arr1 , arr2 , n ) << endl ; return 0 ; }