News for hackers. Stuff that matters.
Re:I cheated on my Microsoft interview (2019) by whiplash451 on Sunday June 05, 2022 @11:26AM (#31631820)
Am I missing something or sorting is n.log(n) when the sum trick is linear time?

In the lack of additional constraint, sorting seems massively overkill.

Not sure why you are saying that sorting is simpler than the sum trick.

Re:I cheated on my Microsoft interview (2019) by paulsutter on Sunday June 05, 2022 @07:00PM (#31635635)
The author spent days thinking about it, whereas sorting is the immediate obvious answer. Developer time is massively more valuable than computer time by a factor of 1000

And the clever approach only works on data that is perfect, and that’s extremely rare in the real world

This is a hypersophomoric question