+ 1
No numerals
Can anyone tell me what is the problem with my code. Only two test cases are passed. https://code.sololearn.com/cF07NI3yTHgc/?ref=app
2 odpowiedzi
+ 5
The problem is that all your different outputs are independent from each other. Just consider a case like
03
where the first digit would be substituted correctly, but afterwards you increment the index and print the raw digit 3 during the same iteration.
Instead, you should only execute one output during each iteration, a switch statement or an if-else if-else statement will suit. Also, you need to rethink when to advance the index additionally to the increment at the end of each iteration.
+ 1
Thanks shadow.