Please tell which test cases are failing

What i did was i first stored all the number in array then i subtracted all the numbers of array with 9 so that if the number was originally less or not if the original number was less then i didn’t do anything but if was greater i replaced it and in order to get output in right way i made new array so that output could be in straight way
my code is

hello @pranjuldwivedi120568
image
output is not correct .
correct output is 9011
if leftmost number is 9 then dont convert it to 0 (leave it as it is) because if we will convert it 0 then output will have leading zeros which is not allowed

still not running https://ide.codingblocks.com/s/253873 and the previous error is resolved


no it is still there

Only on etest case is remaining https://ide.codingblocks.com/s/253873

bro it is still not correct.
image

see dont make it complicated.
read number as string (say s).
check left most charater if it is ‘9’ then leave it as its and for other positions replace s[i] with min(s[i],9-s[i])
if left most char is not ‘9’
then
for each positions replace s[i]=min(s[i],9-s[i])
and then print s

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.