I have written the logic but don't know where I lacked

please check my code

hello @atreyyash

ther is one edge case.
if leftmost digit is 9 then leave it as it is otherwise the output will have leading zero which violates the contraints mentioned in question.

also to convert char into int just subract ‘0’ from it.

and to convert int to char add ‘0’ to it.

here ur updated code->

it is not passing 2 test cases

@atreyyash

check now->

can you tell how to check which test cases i am not passing. It does not shows the value inputted for the particular test case

Go to solution tab . there all test test cases are given .

note->
if u will check test cases then after that ur score for that particular problem will be freezed (ie u cannot score more after seeing testcase)

ss

ss

but if I unlock the test case it would not reward me

yeah . . . . . . that is what i am saying

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.