Code Room
CodingEasycod-g1281
Subject HeapsLevel Entry–Mid~12 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Each ward in a hospital keeps its own roster of outstanding lab requests, already ordered from most urgent to least urgent by a numeric priority score (smaller = more urgent, each roster ascending). The lab wants one combined worklist. Given the rosters as a list of ascending integer lists, produce a single ascending list containing every score. Rosters may be empty, and the same score can appear in several rosters. Example: rosters = [[1, 4, 9], [2, 3]] gives [1, 2, 3, 4, 9].

Implement
combined_worklist(rosters: list[list[int]]) → list[int]
Examples
in[[[1,4,9],[2,3]]]out[1,2,3,4,9]
What a strong answer looks like

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.

Run or narrate your approach, then ask the coach.