Why do I get wrong answer message?

https://www.codechef.com/viewsolution/42622298

Because your answer is wrong

7 Likes

Your program will fail on this testcase:
1001 1

Your code will give output as 999, and that goes against the conditions stated in the problem statement as there should be exactly 1 digit that differs from the correct answer. In addition to that the problem statement also stats that the length of the output should be the same of that of the correct answer of the subtraction without any leading zeroes.

1 Like

Probably you meant this
1001 1

2 Likes

Thanks :man_facepalming: