Hi, My code is https://ide.codingblocks.com/s/123236
It is failing 2 test cases, can you tell me whats the bug here?
(Chewbacca and number problem)
Few Test Cases Are Failing
Hello @ayushg1214,
Your code is skipping the digit 9:
Example 1:
9876
Your Output:
123
Expected Output:
9123
Example 2:
9999
Your Output:
0
Expected Output:
9000
It seems like if you have miss-interpreted the following sentence:
The number shouldn’t contain leading zeroes.
This mean that if the first digit is 9 then you are not required to invert it.
Hope, this would help.
Give a like, if you are satisfied.
1 Like
Thanks, I submitted it successfully!
Anytime.
Please, mark this doubt as resolved.