Answer not matching

I believe the code is correct for the problem case.
But 2 test cases seem to have having problem.
Thank You

Hi @kartikdutt
Please share your code ide so that i can have a look.

@kartikdutt
You have to include the case when x[0]==9 because if we use 9-x formula then x[0] will become 0 and in the ques it is mentioned that the new number should not have leading zeros.

Here is your corrected code :

Ok got it. Thank you very much :slight_smile: