If current element is smaller
if nums [ i ] <= nums [ j ] : NEW_LINE INDENT continue NEW_LINE DEDENT if dp_l [ j ] + 1 > dp_l [ i ] : NEW_LINE INDENT dp_l [ i ] = dp_l [ j ] + 1 NEW_LINE dp_c [ i ] = dp_c [ j ] NEW_LINE DEDENT elif dp_l [ j ] + 1 == dp_l [ i ] : NEW_LINE INDENT dp_c [ i ] += dp_c [ j ] NEW_LINE DEDENT