Architgupta001 / Hacktoberfest-2021

15 stars 129 forks source link

CSES - Removing Digits #242

Open karankc23 opened 2 years ago

karankc23 commented 2 years ago

You are given an integer n. On each step, you may subtract one of the digits from the number.

How many steps are required to make the number equal to 0?

Input

The only input line has an integer n.

Output

Print one integer: the minimum number of steps.

Constraints 1≤n≤106 Example

Input: 27

Output: 5

Explanation: An optimal solution is 27→20→18→10→9→0.

karankc23 commented 2 years ago

Please assign me this issue in c++ language