Driver Code
static public void main ( String [ ] args ) { int [ ] a = { - 10 , - 9 , - 8 , 2 , 7 , - 6 , - 5 } ; int n = a . length ; int k = 2 ; System . out . println ( maxOfSegmentMins ( a , n , k ) ) ; } }