L [ i ] = { MaxSum ( L [ j ] ) } + arr [ i ] where j < i and arr [ j ] < arr [ i ]
if ( ( arr [ i ] > arr [ j ] ) and ( findSum ( L [ i ] ) < findSum ( L [ j ] ) ) ) : NEW_LINE INDENT for e in L [ j ] : NEW_LINE INDENT if e not in L [ i ] : NEW_LINE INDENT L [ i ] . append ( e ) NEW_LINE DEDENT DEDENT DEDENT