Place current digit such that it is more than the previous digit
else : NEW_LINE INDENT for digit in range ( prev + 1 , 10 ) : NEW_LINE INDENT val += solve ( i + 1 , n , digit , 1 ) NEW_LINE DEDENT DEDENT