Stack and Queue
Question Types
Stack
1717. Maximum Score From Removing Substrings
File | confidence | date | difficulty | note |
---|---|---|---|---|
739. Daily Temperatures | 🟡 | March 13, 2024 | - | - |
84. Largest Rectangle in Histogram | 🔴 | March 31, 2024 | hard | - |
1944. Number of Visible People in a Queue | 🔴 | September 26, 2024 | medium | Going in the reversed direction, keep a decreasing stack |
716. Max Stack | 🟡 | October 20, 2024 | - | Additional counter to distinguish between the same elements |
1717. Maximum Score From Removing Substrings | 🔴 | October 20, 2024 | medium | Greedy solution |
636. Exclusive Time of Functions | 🟡 | October 30, 2024 | - | Add starting point to the stack, and also keep a result array and a prev_start variable, to modify result on the run |
2104. Sum of Subarray Ranges | 🔴 | January 11, 2025 | medium | - |
Monotonic Stack
2334. Subarray With Elements Greater Than Varying Threshold
1944. Number of Visible People in a Queue
Queue
1823. Find the Winner of the Circular Game
1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
Method | Related Questions |
---|---|
Monotonic stack | 2104. Sum of Subarray Ranges, 739. Daily Temperatures, 901. Online Stock Span |