Standard Bar Heaps · Medium Problems O(n log k) · O(k)
A signal recorder captures k channels, each already timestamp-ordered, and must replay everything as one interleaved timeline. The blender keeps each channel's earliest unplayed event in a small pool, plays the overall earliest, and refills the pool from that channel's next event — an event at a time, never re-sorting.
Input: A list of k lists, each sorted in ascending order (lists may be empty).
Output: Return one sorted list containing every value from all lists.
0 <= k <= 10^40 <= total nodes <= 10^4-10^4 <= values <= 10^4Each list is sorted in ascending orderInput: {"lists":[[1,4,5],[1,3,4],[2,6]]}
Output: [1,1,2,3,4,4,5,6]
The pool interleaves the three channels into one non-decreasing replay.
Input: {"lists":[[],[]]}
Output: []
Empty channels contribute nothing to the pool.