sum of all numbers of length of len - 1 in which last digit x is <= 'digit
for x in range ( digit + 1 ) : NEW_LINE INDENT dp [ digit ] [ len ] += dp [ x ] [ len - 1 ] NEW_LINE DEDENT count = 0 NEW_LINE