Round-robin scheduler with tasks arriving over time
Your task
Simulate a deterministic single-CPU round-robin scheduler with a fixed time quantum. You get tasks as a list of [name, arrival, burst] (integers, arrival non-decreasing in input order) and an integer quantum. At each step the CPU runs the front task for min(quantum, remaining) ticks; if it still has work it goes to the BACK of the ready queue, but any tasks that ARRIVED during those ticks (arrival <= current_time after running) are enqueued BEFORE the preempted task is re-added. Ties in arrival keep input order. Return the list of task names in the order they COMPLETE.
Examples
round_robin(tasks: list[list], quantum: int) -> list[str]Example 1
Input
round_robin([["A", 0, 5], ["B", 0, 3]], 2)Output
["B", "A"]