Foundations line
Stack problems
A stack is a pile where the last item in is the first out. It fits problems where the most recent unfinished thing is the one to deal with next, such as matching brackets.
- 1 easy
- 4 medium
- 1 hard
The 6 problems
In the order the app teaches them. Each page has the problem, five hints and the explained solution.
- Valid ParenthesesEasy
- Min StackMedium
- Evaluate Reverse Polish NotationMedium
- Daily TemperaturesMedium
- Car FleetMedium
- Largest Rectangle In HistogramHard
On the roadmap
Stack is a station on the foundations line. It builds on Arrays & Hashing. Next comes Linked List.
The roadmap says why each line runs in its order.
Patterns
3 patterns solve these problems. Naming them gives the problems’ methods away, so the list is folded.
Show the 3
- Last-in, first-out stack2 problems
- Purpose-built data structure1 problem
- Monotonic stack3 problems