1 article
Master the monotonic stack — the O(n) pop-while trick behind next greater element, Daily Temperatures, Largest Rectangle, and Trapping Rain Water.