Single-server queue simulation
Simulate a single-server queue deterministically. You are given a list of (arrival, service) tuples sorted by arrival time ascending (integers). The server processes one job at a time in arrival order (FIFO). A job's start time is the max of its arrival time and the previous job's finish time; its finish time is start + service. Return a list of finish times in input order. The list may be empty. All times are non-negative integers.
Implement
simulate_queue(jobs: list[tuple]) → list[int]Examples
in
[[[0,3],[1,2],[5,1]]]out[3,5,6]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.
0:00 of about 35 min
solution.py
InputExpectedGot
[[[0,3],[1,2],[5,1]]][3,5,6]not run yetsample