Hacker News new | ask | show | jobs
by landa 1536 days ago
It actually comes down to a few simple algorithms, only one of which I didn't see in college. These kinds of water problems use a "monotonic stack" if I remember correctly. That's the algorithm that I didn't see in school.

In reality, after you practice a lot of these problems, you realize that there are only a few broad categories and that most of them just use what you learned in school. You just have to practice to become fast.