Statistics

Problem Statement for "TheBeauty"

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

  1. 7

    Returns: 1

    Just one digit.

  2. 100

    Returns: 2

    Two distinct digits - 0 and 1.

  3. 123456789

    Returns: 9

    All the digits are different.

  4. 1000000000

    Returns: 2

  5. 1

    Returns: 1

  6. 2

    Returns: 1

  7. 9

    Returns: 1

  8. 999999999

    Returns: 1

  9. 999989999

    Returns: 2

  10. 301413357

    Returns: 6

  11. 336971125

    Returns: 7

  12. 659598369

    Returns: 5

  13. 77774444

    Returns: 2

  14. 474747474

    Returns: 2

  15. 4890852

    Returns: 6

  16. 932400154

    Returns: 7

  17. 1000

    Returns: 2

  18. 10

    Returns: 2

  19. 10000000

    Returns: 2

  20. 121

    Returns: 2

  21. 1119

    Returns: 2


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: