Can you please explain this question to me . I’m confused about what we suppose to do here I mean do we have to check for the digits at even places or something else.
thank you
Chewbacca and Number
Hello @dishant,
You need to convert a given number by inverting the digits (9- digit at that place) such that it forms the minimum number possible. Also, the new number shouldn’t start with 0.
For example:
Input: 97654
Output: 92344
Here let’s go digit by digit:
9-9 = 0 but we cannot have first digit as 0. Hence it will remain 9.
9-7 = 2 minimum(7,2) = 2, Therefore second digit is 2.
and so on
i’m done till here my first two cases are correct rest showing the run time error and wrong code .