C # program to find out maximum value from a given sequence of coins
using System ; class GFG { static int MAX = 100 ; static int [ , ] memo = new int [ MAX , MAX ] ; static int oSRec ( int [ ] arr , int i , int j , int sum ) { if ( j == i + 1 ) return Math . Max ( arr [ i ] , arr [ j ] ) ; if ( memo [ i , j ] != - 1 ) return memo [ i , j ] ;