Opening page…
Keep a stack in sorted order to find the next greater or smaller element for every position in one pass.
Solved
| Solved | # | Problem | Pattern | Level | Preview |
|---|---|---|---|---|---|
| 1 | Next Greater Element I | monotonic stack · next greater | Easy | ||
| 2 | Daily Temperatures | monotonic stack · next greater | Medium | ||
| 3 | Online Stock Span | monotonic stack · previous greater | Medium | ||
| 4 | Remove K Digits | monotonic stack · greedy | Medium | ||
| 5 | Sum of Subarray Minimums | monotonic stack · contribution counting | Medium | ||
| 6 | Largest Rectangle in Histogram | monotonic stack · previous/next smaller | Hard |
Showing 1–6 of 6 problems