Driver code
public static void Main ( String [ ] args ) { int [ ] arr1 = { 2 , - 4 , 5 , 3 } ; int [ ] arr2 = { 0 , 1 , 0 , 1 } ; int n = arr1 . Length ; Console . WriteLine ( maxSum ( arr1 , arr2 , n ) ) ; } }