If MP [ V [ j ] ] is 0 and V [ j ] is less than or equal to arr [ i ]
if ( V [ j ] not in MP and V [ j ] <= arr [ i ] ) : NEW_LINE INDENT arr [ i ] -= V [ j ] NEW_LINE MP [ V [ j ] ] = 1 NEW_LINE DEDENT