+ 1
Why time limit exceeded?
2 Answers
+ 6
a=0 and i=0 at the start and the condition a<=i is true. In every iteration, both variables are incremented meaning the condition is always true thus resulting in an infinite loop.
In code playground, there's a limit to the time taken for execution of a program. When it is crossed, execution is stopped and "Time Limit Exceeded" message will be displayed.
+ 2
Because when you check the while condition a is always equal to I, since they start equal and you always increment them by the same amount "at the same time".