Statistics

Problem Statement for "DivisorDigits"

Problem Statement

Create a class DivisorDigits containing a method howMany which takes an int number and returns how many digits in number divide evenly into number itself.

Definition

Class:
DivisorDigits
Method:
howMany
Parameters:
int
Returns:
int
Method signature:
int howMany(int number)
(be sure your method is public)

Notes

  • No number is divisible by 0.

Constraints

  • number will be between 10000 and 999999999.

Examples

  1. 12345

    Returns: 3

    12345 is divisible by 1, 3, and 5.

  2. 33333

    Returns: 5

  3. 661232

    Returns: 3

    661232 is divisible by 1 and 2.

  4. 52527

    Returns: 0

    52527 is not divisible by 5, 2, or 7.

  5. 98765

    Returns: 1

  6. 730000000

    Returns: 0

    Nothing is divisible by 0. In this case, the number is also not divisible by 7 or 3.

  7. 273472734

    Returns: 4

  8. 999999999

    Returns: 9

  9. 918273645

    Returns: 4

  10. 203948576

    Returns: 3

  11. 102938475

    Returns: 3

  12. 512667324

    Returns: 7

  13. 227345383

    Returns: 0

  14. 1622361

    Returns: 3

  15. 32252

    Returns: 3

  16. 100000

    Returns: 1

  17. 124175603

    Returns: 2

  18. 11111111

    Returns: 8

  19. 1234567

    Returns: 1

  20. 7000000

    Returns: 1

  21. 12121212

    Returns: 8

  22. 17000

    Returns: 1

  23. 10000

    Returns: 1

  24. 200001

    Returns: 1

  25. 60000

    Returns: 1

  26. 44444

    Returns: 5

  27. 666666

    Returns: 6

  28. 220000

    Returns: 2

  29. 1111111

    Returns: 7

  30. 730000000

    Returns: 0

  31. 9999999

    Returns: 7

  32. 73000111

    Returns: 3

  33. 100000

    Returns: 1

  34. 11111

    Returns: 5

  35. 661232

    Returns: 3

  36. 10000

    Returns: 1

  37. 99999

    Returns: 5


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: