Removing Digits
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
You are given an integer n. On each step, you may subtract from it any one-digit number that appears in it.
How many steps are required to make the number equal to 0?
Input
One integer n (1 ≤ n ≤ 10^6
).
Output
Print one integer: the minimum number of steps.
Examples
Input #1
Answer #1
Note
An optimal solution is 27 → 20 → 18 → 10 → 9 → 0.
Submissions 2K
Acceptance rate 56%