Java program to find out maximum value from a given sequence of coins
import java . util . * ; 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 ] ;