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)