JuniorMath
Count the Digits That Divide a Number
Given an integer num, return the number of digits in num that divide num.
An integer val divides nums if nums % val == 0.
Example 1
Input
num = 7Output
17 divides itself, hence the answer is 1.
Example 2
Input
num = 121Output
2121 is divisible by 1, but not 2, and since 1 occurs twice as a digit, we return 2.
Constraints
- 1 <= num <= 10^9
- num does not contain 0 as one of its digits.