TopCoder problem "UniqueDigits" used in SRM 280 (Division II Level One)



Problem Statement

    

Given an int n find all positive integers less than n whose digits are all different. Return the total number of such integers.

 

Definition

    
Class:UniqueDigits
Method:count
Parameters:int
Returns:int
Method signature:int count(int n)
(be sure your method is public)
    
 

Constraints

-n will be between 1 and 10000 inclusive.
 

Examples

0)
    
21
Returns: 19
We count all integers between 1 and 20, except 11.
1)
    
101
Returns: 90
2)
    
1001
Returns: 738
3)
    
1
Returns: 0

Problem url:

http://www.topcoder.com/stat?c=problem_statement&pm=5988

Problem stats url:

http://www.topcoder.com/tc?module=ProblemDetail&rd=8077&pm=5988

Writer:

dimkadimon

Testers:

PabloGilberto , brett1479 , Olexiy

Problem categories:

Brute Force