Question
You are given `streams`, a list of already-ascending lists of integer timestamps (each individual stream is sorted, but the streams are independent). Merge them into a single ascending list of timestamps. Duplicate timestamps across or within streams are all kept. Implement an efficient k-way merge rather than concatenating and sorting. Some streams may be empty; `streams` itself may be empty.
merge_streams(streams: list[list[int]]) → list[int][[[1,4,7],[2,3],[5]]]out[1,2,3,4,5,7]State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.