Rule of thumb for avoiding TLE
4161

I'm wondering if there exists a rule of thumb for estimating whether certain time complexity will cause a TLE in LeetCode?

For example, if the scale of the problem N ~ 10^5, then a O(n^2) solution will most likely cause TLE, but a O(nlogn) solution will probably be OK. So I feel like there's some rough number (may ~ 10^6) that is the boundary between success and failure. Is there such thing? Thanks!

Comments (3)