Python stack and queue problems
Last in, first out and first in, first out: stack and queue problems in Python, with tests that check your code.
Beginner
- 43. Hot PotatoPass it around the circle: who is the last one standing?40 XP8 min
- 48. Balanced BracketsDoes every bracket close in the right order?45 XP8 min
- 533. Binary by Stacking RemaindersTurn a whole number into ones and zeros the way a computer would30 XP5 min
- 564. Customers From One CityStack up the customer records for one city, then take them all off35 XP7 min
- 571. Reverse Each Word With a StackEvery word backwards, but the sentence still in its usual order35 XP6 min
- 577. Run the Stack CommandsPush, pop, peek and display on a pile of items40 XP8 min
Intermediate
- 63. Queue From Two StacksFirst in, first out, built from two last-in-first-out piles60 XP12 min
- 73. Reverse Polish CalculatorArithmetic with no brackets, where the operator comes last65 XP12 min
- 76. Tidy a File PathUntangle a folder path full of dots and extra slashes65 XP12 min
- 85. Stack With a MinimumA stack that always knows its smallest item70 XP12 min
- 96. Ring BufferA fixed-size queue that recycles its oldest slot75 XP15 min
- 103. Wait for a Warmer DayHow long until it gets warmer than today?80 XP15 min
- 595. Where the Brackets Go WrongPoint at the exact bracket that breaks the pattern65 XP12 min
- 599. Check and Evaluate PostfixWork out a postfix sum, or catch the ones that make no sense70 XP15 min
- 608. Undo the Spreadsheet EditsA spreadsheet that can take back every change, one at a time75 XP15 min
- 610. Infix to PostfixRewrite a formula so that every operator comes after its numbers90 XP18 min
Advanced
Expert
Other topics
- Python Basics
- Strings
- Lists
- Dictionaries and sets
- Loops
- Functions
- Math
- Errors and exceptions
- File handling
- Modules and random
- Sorting and searching
- Two pointers
- Sliding window
- Recursion and backtracking
- Dynamic programming
- Greedy
- Graphs
- Trees
- Bit manipulation
- Classes
- Iterators and generators
- Parsing
- Simulation
- Python idioms
- Regular expressions
- Codes and ciphers
- Working with data
- Grids and matrices
- Geometry
- Games and puzzles
- Heaps
- Data structures
Or see every challenge, with study plans, today's challenge and duels.