Given num, repeat these rules until it reaches 0 and return the number of steps used:
num
0
num = 14
6
Why
14 → 7 → 6 → 3 → 2 → 1 → 0
num = 8
4
0 <= num <= 10^6
Topics
Implement numberOfSteps in the editor and return the answer — printing it is never graded.
numberOfSteps
Problem 50 of 1146 in the arena