Error “Time Limit Exceeded”, what to do?

Created by Shubham Kumar, Modified on Tue, 02 Apr 2024 at 02:40 PM by Shubham Kumar

We look for optimal algorithms in your solutions. Every problem has a time limit with respect to its optimal solution. 


If your code could not produce the required output within the set time limit, you get a “Time Limit Exceeded” error. 


Test cases get progressively larger, so it is common for a naive solution to pass the first few (smaller) test cases and then fail when confronted with the bigger ones.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article