CHEWBACCA AND NUMBER problem

https://ide.codingblocks.com/#/s/27943

where I am wrong?

CHEWBACCA AND NUMBER(roblem statement)
Luke Skywalker gave Chewbacca an integer number x. Chewbacca isn’t good at numbers but he loves inverting digits in them. Inverting digit t means replacing it with digit 9 - t.

Help Chewbacca to transform the initial number x to the minimum possible positive number by inverting some (possibly, zero) digits. The decimal representation of the final number shouldn’t start with a zero.

1 Like

can you provide me with the link for the problem so that i can try submitting your code.
i am not sure whether we have to change ‘9’ to ‘0’, because:
input: 9
your output: 9
expected output: (according to my understanding right now) 0.
rest of the cases are handled correctly. please attach the problem link so that i can clarify…