Hacker News new | ask | show | jobs
by mellowdream 2363 days ago
I actually looked through a few LeetCode problems a couple months back and had a brief panic that I found tricky/nonintuitive to formally prove from first principles problems that were apparently "easy" or "trivial" to just intuit (as LeetCode commenters tend to characterize, anyway). I was never satisfied with people's "oh, just do xyz and it makes sense" - I just assumed I was dumb... Still not sure what to make of this - I'm not the only one, I guess... ?
1 comments

If you've ever checked out "Cracking the Coding Interview", you'll see there are many "algorithmic tricks" people can use to quickly improve performance while performing operations. An example from this problem, the author uses "a two pointer approach" to inch the head and tail pointers closer to one another, to cover all pertinent combinations and reduce run time. There are all kinds of little idioms, and many people that would take the time to comment on LeetCode forums are likely well versed in them.