Driver code
public static void main ( String [ ] args ) { int arr [ ] = { - 5 , 3 , 2 , 7 , - 8 , 3 , 7 , - 9 , 10 , 12 , - 6 } ; int n = arr . length ; System . out . println ( maxSum ( arr , n ) ) ; } }