TopCoder problem "TheBeauty" used in SRM 437 (Division II Level One)



Problem Statement

    

There is nothing more beautiful than just an integer number.

The beauty of an integer is the number of distinct digits it contains in decimal notation.

You are given an integer number n. Return the beauty of this number.

 

Definition

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

Constraints

-n will be between 1 and 1,000,000,000, inclusive.
 

Examples

0)
    
7
Returns: 1
Just one digit.
1)
    
100
Returns: 2
Two distinct digits - 0 and 1.
2)
    
123456789
Returns: 9
All the digits are different.
3)
    
1000000000
Returns: 2
4)
    
932400154
Returns: 7

Problem url:

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

Problem stats url:

http://www.topcoder.com/tc?module=ProblemDetail&rd=13699&pm=10233

Writer:

Vasyl[alphacom]

Testers:

PabloGilberto , bmerry , ivan_metelsky

Problem categories:

Simulation