Help needed in this problem

Revision en1, by aya1909, 2020-10-30 19:10:29

given a number n, convert it into k such that k has all even digit with minimum no of operations. 1 operation is either increment or decrement n by 1.

example: Input 11 output -> 3 Input 199 output -> 1 Input 2018 output -> 2

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English aya1909 2020-10-30 19:10:29 267 Initial revision (published)