Chewbacca and number

https://online.codingblocks.com/app/player/11915/content/54857/4713/code-challenge
https://ide.geeksforgeeks.org/cc0kloLEp0
why isn’t my code running

Hello @anitagupta1411
image

this loop will modify ur n ,which we dont want because later we need n.
so store n in some variable and use that variable instead of n.

https://ide.geeksforgeeks.org/hLShNk8F41 now what is the problem in code

image
here in place of while loop use if statement , because we need to check for only left most digit.
ex -> if input is 999 then output should be 900

https://ide.geeksforgeeks.org/XFaxxhzllY
it is still failing in 2 testcases and in case of while we had to use for so how will time complexity change

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.