Monotonic Queue LeetCode Problems: All 17, With Python Solutions
Every problem in this library that LeetCode tags Monotonic Queue — 17 in total, 15 of them with a complete Python solution, a worked example and the time and space complexity of the approach.
- 17 problems
- 0 Easy
- 5 Medium
- 12 Hard
How Monotonic Queue problems are solved
A tag names the subject, not the method. These pattern hubs cover the techniques that actually solve Monotonic Queue problems — each one explains the approach, gives a Python template and states its complexity.
- Monotonic Stack — Answer "what is the next greater element" for every position in one pass.
Monotonic Queue problems by difficulty
Problems with a complete Python solution are listed first, then by ascending problem number.
Medium (5)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 918 | Maximum Sum Circular Subarray | Medium | Queue, Array, Divide and Conquer +2 |
| 1438 | Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit | Medium | Queue, Array, Ordered Set +3 |
| 1696 | Jump Game VI | Medium | Queue, Array, Dynamic Programming +2 |
| 2762 | Continuous Subarrays | Medium | Queue, Array, Ordered Set +3 |
| 2944 | Minimum Number of Coins for Fruits | Medium | Queue, Array, Dynamic Programming +2 |
Hard (12)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 239 | Sliding Window Maximum | Hard | Queue, Array, Sliding Window +2 |
| 862 | Shortest Subarray with Sum at Least K | Hard | Queue, Array, Binary Search +4 |
| 1425 | Constrained Subsequence Sum | Hard | Queue, Array, Dynamic Programming +3 |
| 1499 | Max Value of Equation | Hard | Queue, Array, Sliding Window +2 |
| 1687 | Delivering Boxes from Storage to Ports | Hard | Segment Tree, Queue, Array +4 |
| 2071 | Maximum Number of Tasks You Can Assign | Hard | Greedy, Queue, Array +4 |
| 2398 | Maximum Number of Robots Within Budget | Hard | Queue, Array, Binary Search +4 |
| 2407 | Longest Increasing Subsequence II | Hard | Binary Indexed Tree, Segment Tree, Queue +4 |
| 2444 | Count Subarrays With Fixed Bounds | Hard | Queue, Array, Sliding Window +1 |
| 2945 | Find Maximum Non-decreasing Array Length | Hard | Stack, Queue, Array +4 |
| 683 | K Empty SlotsPremium | Hard | Binary Indexed Tree, Segment Tree, Queue +5 |
| 2969 | Minimum Number of Coins for Fruits IIPremium | Hard | Queue, Array, Dynamic Programming +2 |
Keep exploring
- Array1,569
- String672
- Hash Table588
- Math485
- Dynamic Programming481
- Sorting392
- Greedy346
- Depth-First Search289
- Binary Search253
- Database249
- Tree225
- Breadth-First Search223
- Matrix216
- Two Pointers201
- Bit Manipulation194
- Binary Tree174
- Heap (Priority Queue)163
- Prefix Sum157
- Stack157
- Simulation144
- Graph138
- Counting126
- Design122
- Sliding Window116
When the Monotonic Queue problem arrives live
Stealth Interview is a desktop app for macOS and Windows. It reads the coding problem off your screen, returns a working solution with a step-by-step explanation and its time and space complexity, and transcribes what the interviewer is saying — while staying invisible to screen sharing.