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
1 pattern

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)

Easy problems
No.Problem
0225Implement Stack using Queues
0232Implement Queue using Stacks
0387First Unique Character in a String
0933Number of Recent Calls
1700Number of Students Unable to Eat Lunch
2073Time Needed to Buy Tickets
0346Moving Average from Data StreamPremium

Medium (19)

Medium problems
No.Problem
0341Flatten Nested List Iterator
0622Design Circular Queue
0641Design Circular Deque
0649Dota2 Senate
0918Maximum Sum Circular Subarray
0950Reveal Cards In Increasing Order
1438Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
1670Design Front Middle Back Queue
1696Jump Game VI
1823Find the Winner of the Circular Game
2327Number of People Aware of a Secret
2526Find Consecutive Integers from a Data Stream
2762Continuous Subarrays
2944Minimum Number of Coins for Fruits
0281Zigzag IteratorPremium
0353Design Snake GamePremium
0362Design Hit CounterPremium
0379Design Phone DirectoryPremium
1429First Unique NumberPremium

Hard (17)

Hard problems
No.Problem
0239Sliding Window Maximum
0862Shortest Subarray with Sum at Least K
0936Stamping The Sequence
0995Minimum Number of K Consecutive Bit Flips
1425Constrained Subsequence Sum
1499Max Value of Equation
1687Delivering Boxes from Storage to Ports
1825Finding MK Average
2071Maximum Number of Tasks You Can Assign
2398Maximum Number of Robots Within Budget
2407Longest Increasing Subsequence II
2444Count Subarrays With Fixed Bounds
2528Maximize the Minimum Powered City
2945Find Maximum Non-decreasing Array Length
0683K Empty SlotsPremium
2534Time Taken to Cross the DoorPremium
2969Minimum Number of Coins for Fruits IIPremium