Queue LeetCode Problems: All 43,
With Python Solutions
Every problem in this library that LeetCode tags Queue. 34 of them carry a complete Python solution, a worked example and the time and space complexity of the approach.
- Easy
- 7
- Medium
- 19
- Hard
- 17
How Queue problems are solved
A tag names the subject, not the method. These pattern hubs cover the techniques that actually solve Queue problems — each one explains the approach, gives a Python template and states its complexity.
Eyes only
When the Queue problem arrives live.
In the live round, Stealth Interview reads the 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 says. It's a desktop app for macOS and Windows, invisible to screen sharing.
Queue problems by difficulty
Problems with a complete Python solution are listed first, then by ascending problem number.
Easy (7)
| No. | Problem | Topics |
|---|---|---|
| 0225 | Implement Stack using Queues | |
| 0232 | Implement Queue using Stacks | |
| 0387 | First Unique Character in a String | |
| 0933 | Number of Recent Calls | |
| 1700 | Number of Students Unable to Eat Lunch | |
| 2073 | Time Needed to Buy Tickets | |
| 0346 | Moving Average from Data StreamPremium |
Medium (19)
| No. | Problem | Topics |
|---|---|---|
| 0341 | Flatten Nested List Iterator | |
| 0622 | Design Circular Queue | |
| 0641 | Design Circular Deque | |
| 0649 | Dota2 Senate | |
| 0918 | Maximum Sum Circular Subarray | |
| 0950 | Reveal Cards In Increasing Order | |
| 1438 | Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit | |
| 1670 | Design Front Middle Back Queue | |
| 1696 | Jump Game VI | |
| 1823 | Find the Winner of the Circular Game | |
| 2327 | Number of People Aware of a Secret | |
| 2526 | Find Consecutive Integers from a Data Stream | |
| 2762 | Continuous Subarrays | |
| 2944 | Minimum Number of Coins for Fruits | |
| 0281 | Zigzag IteratorPremium | |
| 0353 | Design Snake GamePremium | |
| 0362 | Design Hit CounterPremium | |
| 0379 | Design Phone DirectoryPremium | |
| 1429 | First Unique NumberPremium |
Hard (17)
Keep exploring
Other topics
- 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