Javascript program to find out maximum value from a given sequence of coins
let MAX = 100 ; let memo = new Array ( MAX ) ; for ( let i = 0 ; i < MAX ; i ++ ) { memo [ i ] = new Array ( MAX ) ; for ( let j = 0 ; j < MAX ; j ++ ) { memo [ i ] [ j ] = 0 ; } } function oSRec ( arr , i , j , sum ) { if ( j == i + 1 ) return Math . max ( arr [ i ] , arr [ j ] ) ; if ( memo [ i ] [ j ] != - 1 ) return memo [ i ] [ j ] ;