0

# TIME LIMIT EXCEED ERROR

I am getting an error called TIME LIMIT EXCEED ERROR(TLE) when running an challenge on a website. Hence i got some test cases cleared... But now i know it can happen with all languages.. How can i avoid this? How to solve this? Python was the language i have used

1 Answer

0

It depends on the size of the input and time complexity of your program.
Assuming you understand the big O notation, here are some guidelines:
Input size - Required time complexity:
n <= 10 - O(n!)
n <= 20 - O(2ⁿ)
n <= 500 - O(n³)
n <= 5000 - O(n²)
n <= 10⁶︎ - O(n log n) or O(n)
large n - O(log n) or O(1)