Implement prototype(feeds: list[list[int]]) -> list[int] and solve with the same signature. Each inner list is already sorted in nondecreasing order. Return all integers in one nondecreasing list, preserving duplicates. Empty feeds and an empty outer list are valid.
Example: [[], [1, 4], [1, 2, 8]] returns [1, 1, 2, 4, 8].
Prototype: concatenate and sort. Final: use one heap candidate per active feed. Do not modify the outer list or any inner list. Inputs otherwise satisfy the contract; extra validation is not required. Account for inspecting all feeds as well as emitting all values.
Drag or use the arrow keys to resize. Home collapses the question; End collapses the editor. Enter or double-click resets the split.
Loading editor…
Loading editor…
No results yet.
Complete the starter code, then run the checks.
Results and errors will appear here.