Function to return the count of n - digit numbers with all distinct digits
def countNum ( n ) : NEW_LINE INDENT if ( n > 10 ) : NEW_LINE INDENT return 0 ; NEW_LINE DEDENT return ( 9 * factorial ( 9 ) // factorial ( 10 - n ) ) ; NEW_LINE DEDENT