If a digit has occurred for the second time , then set repeated to 1
if ( mask & ( 1 << i ) ) : NEW_LINE INDENT val += countOfNumbers ( digit + 1 , mask | ( 1 << i ) , 1 , n ) NEW_LINE DEDENT else : NEW_LINE INDENT val += countOfNumbers ( digit + 1 , mask | ( 1 << i ) , 0 , n ) NEW_LINE DEDENT