Finding the new tight
if ( tight and i == upper_limit ) : NEW_LINE INDENT new_tight = 1 NEW_LINE DEDENT else : NEW_LINE INDENT new_tight = 0 NEW_LINE DEDENT res += possibleNumber ( pos + 1 , i , new_tight , True , N , K ) NEW_LINE