30:00
Given an integer num, return the number of digits in num that divide num.
num
A digit d divides num when num % d == 0. A digit that appears more than once is counted once per appearance.
d
num % d == 0
1≤num≤1091 \leq num \leq 10^91≤num≤109
num does not contain 0 as one of its digits.
0
Run code to see results.
Start with count = 0 and a copy x = 7. We peel digits off x from the right and test each against the original num.
num = 7, peeled from the right
x
✗
x = 7
d = x % 10, then test num % d
count
Given an integer num with no zero digits, return how many of its digits divide num evenly, counting a repeated digit once per appearance.