0
Time limit exceeded
I have a problem: the code is written, but the time limit is exceeded. How do I rewrite the code to make it work? https://code.sololearn.com/cyw7t0g41BOh/?ref=app
5 Antworten
+ 3
A for loop works like this: for(declare variable; condition; raise variable)
You put candy++ where you should have put the condition, so it will never return false and the loop will never end.
+ 1
change
for( ... ; ... ;)
to
for(; ... ; ... )
0
Thanks
0
Moritz Vogel I think like you said it will never return false instead of true🤔🤔😂
0
Moritz Vogel Just edit it and we'll delete the other posts.