Find envelopes count for each envelope
for j in range ( i ) : NEW_LINE INDENT if ( envelopes [ i ] [ 0 ] > envelopes [ j ] [ 0 ] and envelopes [ i ] [ 1 ] > envelopes [ j ] [ 1 ] and dp [ i ] < dp [ j ] + 1 ) : NEW_LINE INDENT dp [ i ] = dp [ j ] + 1 NEW_LINE DEDENT DEDENT