Python iterator and generator exercises
Produce values one at a time with Python iterators and generators, on problems with tests.
Beginner
Intermediate
- 92. Interleave StreamsDeal items from several sources like cards around a table75 XP14 min
- 285. Pairs of NeighboursWalk a route leg by leg, and maybe back to the start65 XP12 min
- 299. Batches of NPack a stream of items into boxes of the same size70 XP14 min
- 334. Unique, in OrderSkip the repeats in a stream, even ones a set cannot hold80 XP15 min
Advanced
- 147. Flatten Anything, LazilyUnpack boxes inside boxes inside boxes, however deep they go135 XP30 min
- 356. Endless PrimesA prime number fountain that never runs dry125 XP25 min
- 374. Build Your Own rangeRebuild a built-in that holds a quintillion numbers in a few bytes135 XP30 min
- 390. Merge Sorted StreamsMany sorted feeds, one sorted timeline, read a little at a time140 XP30 min
Expert
Other topics
- Python Basics
- Strings
- Lists
- Dictionaries and sets
- Loops
- Functions
- Math
- Sorting and searching
- Two pointers
- Sliding window
- Stacks and queues
- Recursion and backtracking
- Dynamic programming
- Greedy
- Graphs
- Trees
- Bit manipulation
- Classes
- 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.