Python3 program to find out maximum value from a given sequence of coins
MAX = 100 NEW_LINE memo = [ [ 0 for i in range ( MAX ) ] for j in range ( MAX ) ] NEW_LINE def oSRec ( arr , i , j , Sum ) : NEW_LINE INDENT if ( j == i + 1 ) : NEW_LINE INDENT return max ( arr [ i ] , arr [ j ] ) NEW_LINE DEDENT if ( memo [ i ] [ j ] != - 1 ) : NEW_LINE INDENT return memo [ i ] [ j ] NEW_LINE DEDENT DEDENT