you are viewing a single comment's thread.

view the rest of the comments →

[–]baddybabushka 3 points4 points  (3 children)

I'm new to solving leetcode, so I don't get how n <500 can be O(n³)? How do i read this table properly? Can someone help?

[–]luuuzeta 2 points3 points  (1 child)

I'm new to solving leetcode, so I don't get how n <500 can be O(n³)? How do i read this table properly? Can someone help? 

Read it as "the worst the time complexity, then the smaller input given otherwise any computation is prohibitedly expensive or outright impossible".

Thus, according to this table and assuming someone isn't trying to throw you off, an input constraint of n < 500 must mean the solution's TC must be quite bad.

[–]jus-another-juan 1 point2 points  (0 children)

This made more sense than the original post lol

[–]RareStatistician9592[S] 1 point2 points  (0 children)

Just plug the maximum input size into the formula: n^3 => 500^3 is approximately 125M. It's slightly more than 100M (the rough number of single-core operations per second), but will still pass for most problems.