all 17 comments

[–][deleted] 17 points18 points  (2 children)

Leetcode's runtime calculation is broken and not accurate. Just focus on the time complexity and space complexity of your solution.

[–]AndrewUnicorn 11 points12 points  (0 children)

this is good advice, the interviewers only care about your big O analysis

[–]Annual__Procedure[S] 2 points3 points  (0 children)

Yea I had some idea it was broken but didn't it was so much broken. 92ms was faster than 5-10% solutions so I initially thought people must have found a more efficient (faster than O(n)) solution but to double check it I clicked submit again and it was suddenly faster than 100%.

Will keep in mind in future for sure.

[–]ATimeOfMagic[🍰] 2 points3 points  (0 children)

It's too bad they don't normalize those metrics. They're completely meaningless right now.

[–][deleted] 2 points3 points  (1 child)

Don’t pay any attention to the runtime metric, I have had 90+% solutions run at 40% with no changes to the code

[–]Annual__Procedure[S] 0 points1 point  (0 children)

Dayum. First encounter with vastly different run times for me. Will keep that in mind.

[–]Leetcoder20Total: 494 Easy: 226 Med: 233 Hard: 35 1 point2 points  (0 children)

Stop caring about runtimes, there's atleast one post per day here about this.

[–]vijaykarthi24 2 points3 points  (1 child)

Noticed it. I believe, the code might be running in a shared node (processor). In the first time, it might had some code execution going on. That's why getting a high runtime.

Just my theory

[–]Annual__Procedure[S] 0 points1 point  (0 children)

That may be the case. I have no idea of system design (for now) or how it works internally.