The Five Signals: How to Spot a Stack Problem
How to Know a Problem Wants a Stack Building the Intuition
How to Know a Problem Wants a Stack Building the Intuition
DSA
In our last post we learned the next greater element — for each number, find the next bigger one to its right. Today's problem, "daily temperatures", is that exact same idea with one small but interesting twist. Instead of asking "what is the next warmer day?
DSA
Master this one small problem, and you will suddenly understand why the monotonic stack works.
DSA
Your First Taste of the Monotonic Stack
Stack
Here is a question that sounds innocent but has tripped up many good engineers: "Can you design a stack that returns its minimum and maximum element in constant time?"
DSA
The Problem That Made Me Fall in Love With Stacks
DSA
A Classic Interview Favourite
DSA
To get differentiated do use use a second Stack