Driver code
public static void main ( String [ ] args ) { int arr1 [ ] = { 2 , - 4 , 5 , 3 } ; int arr2 [ ] = { 0 , 1 , 0 , 1 } ; int n = arr1 . length ; System . out . println ( maxSum ( arr1 , arr2 , n ) ) ; } }