[Community Puzzle] Next growing number

Hello, the last test is not valid for me. I have used one loop to increment n and another one to compare each two digits, starting from left.
Any hint to optimize that ?

I can’t pass the Validator 1, can i have a similar execution of this validator pls ?

General advice:
If your language can handle big integers, try to calculate N+1, convert it back to string and start from here, it will be wayyy easier.

1 Like

Think about what the problem is. If you have a 400 digit number, is incrementing by one something that can be done in a feasible amount of time? codingame has a limit of 2 seconds per test case roughly.