Returns optimal value possible that a player can collect from an array of coins of size n . Note than n must be even
function optimalStrategyOfGame ( arr , n ) { let sum = 0 ; for ( let i = 0 ; i < n ; i ++ ) { sum += arr [ i ] ; } return oSRec ( arr , 0 , n - 1 , sum ) ; }