Implement prototype(jobs: list[tuple[str, int, int]]) -> list[str] and solve with the same signature. Jobs are (unique_id, start, end) with integer times and end > start; otherwise raise ValueError.

Return IDs in the order selected by sorting jobs by (end, start, id) and accepting each job whose start is at least the last accepted end. Empty input returns []. Touching jobs are compatible. Example: [('b',0,2), ('a',0,2), ('c',2,3)] returns ['a','c'].

Prototype: explore subsets but reproduce this canonical optimum. Final: implement earliest-finish selection in O(n log n) time. Preserve inputs, including on failure.

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…
No results yet.

Complete the starter code, then run the checks.
Results and errors will appear here.