Driver code
public static void main ( String args [ ] ) { int [ ] arr = { - 9 , 21 , 24 , 24 , - 51 , - 6 , 17 , - 42 , - 39 , 33 } ; int size = arr . length ; System . out . println ( maxSum ( arr , size ) ) ; } }