Make All digits of N even
Anonymous User
509

Given integer N, you can perform increment or decrement operation. You have to convert N into number whose all digits are even.
Find the minimum number of operations required to get desired output.

Constraints:
1 <= N <= 10^16

Input:
42
Output:
0

Input:
11
Output:
3
Explaination: We will convert 11 to 8, so 3 decrement operations

Comments (1)