27. Merge Sorted Streams Lazily
Difficulty: Hard · Topic: Generators & iterators
An advanced Python problem: unlock it to open the statement, sample test and editor. Graded against 7 tests.
Learn the concepts
- Heaps, top-k and k-way merges · 7 min read. heapq, top-k in O(n log k), tie-breaking tuples, and merging sorted streams.
More Python problems
- Read a File in Chunks · Easy
- Batch an Iterable · Easy
- A Generator Pipeline · Medium
- Moving Average over a Stream · Medium
- Flatten Any Iterable Lazily · Medium
- A Re-iterable Date Range · Medium