Chewbacca and Number


It is showing 2 test cases wrong!
What is wrong with the code??

@a19JE0093
Actually here question says " final number shouldn’t start with a zero" that means s[0] can never be 0. Consider this testcase
“9927”
It’s ans should be "9022’ not “22” as returned by your code. Simply add this condition ( if(i==0 && ((s[i] - ‘0’)==9)){ continue; } ) after line no 7, your code will pass all testcase

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.