0

Can't pass the 3rd test in No Numerals exercise

https://code.sololearn.com/c2ervSc4jDCZ/?ref=app This is my code, it passes all the tests but 3rd. I can't understand what's wrong with it. I will appreciate your answer!

5th Jan 2020, 11:46 AM
Vitaliy Reshetar
Vitaliy Reshetar - avatar
2 odpowiedzi
+ 2
Vitaliy Reshetar , the problem is that if string contains 10 your output is ten zero => it should be just 10. Based on your logic if you met 1 followed by 0, you should skip not one step but two ( because next is zero and you are checking it twice). Just change line 21 of your code => i+=2;. Look also at the corrected code. Hope now everything is clear 🐱 https://code.sololearn.com/cuS07qRZSn6u/?ref=app
5th Jan 2020, 12:06 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 1
By the way it also works if the i++ is added before the second continue (line 26)
5th Jan 2020, 1:26 PM
Vitaliy Reshetar
Vitaliy Reshetar - avatar