Driver code
static public void main ( String [ ] args ) { int [ ] arr1 = { 8 , 15 , 3 , 7 } ; int n = arr1 . length ; System . out . println ( optimalStrategyOfGame ( arr1 , n ) ) ; int [ ] arr2 = { 2 , 2 , 2 , 2 } ; n = arr2 . length ; System . out . println ( optimalStrategyOfGame ( arr2 , n ) ) ; int [ ] arr3 = { 20 , 30 , 2 , 2 , 2 , 10 } ; n = arr3 . length ; System . out . println ( optimalStrategyOfGame ( arr3 , n ) ) ; } }