why do i get a "time limit exceeded" message whilst testing my code in the code playground? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

why do i get a "time limit exceeded" message whilst testing my code in the code playground?

27th Oct 2016, 3:52 PM
Warrior Queen
Warrior Queen - avatar
5 Answers
+ 4
It means your code takes too long to execute. It may mean you have an infinite loop for example.
27th Oct 2016, 6:59 PM
Zen
Zen - avatar
+ 4
The way it works is, your program is compiled and executed on a remote server, and sends back all the output at once once terminated or it reaches the time limit. Any input has to be given ahead of time. If you made a mini-menu, I guess you put it in an infinite loop, and you were probably expecting more interactivity than sending everything before your program even asks.
28th Oct 2016, 8:30 PM
Zen
Zen - avatar
0
yeah that usually happens with functions which call themselves like def func(x) if x==1: return whatever else: return x*func(x-1) If "x" is very big, even a computer it will give an error related to limited memory
28th Oct 2016, 5:12 PM
Iago Muñoz Varela
Iago Muñoz Varela - avatar
0
so how can i avoid loads of memory in my code, i mean i only made a mini menu and the thing said time limit exceeded!
28th Oct 2016, 7:27 PM
Warrior Queen
Warrior Queen - avatar
0
well, depending on the code you want to use, maybe you can or You cant optimize it
28th Oct 2016, 7:46 PM
Iago Muñoz Varela
Iago Muñoz Varela - avatar