Laser cutter job order
A sign shop shares one laser cutter across the jobs waiting for it, so no long job can hold the machine all morning. Each entry in jobs is one waiting job written as "panel-a|40": a name, a pipe, then the whole minutes of cutting it still needs. The list is in waiting order, names are unique, and every job needs at least one minute. The operator takes the job at the front of the line and runs it for at most slice_minutes. A job that reaches zero minutes leaves the shop. A job that still needs time goes to the back of the line and waits for another turn. Return the job names in the order they finish.
cutter_finish_order(jobs: list[str], slice_minutes: int) → list[str][["panel-a|40","panel-b|15","panel-c|30"],20]out["panel-b","panel-a","panel-c"][["door|10","shelf|10","lid|10"],25]out["door","shelf","lid"][["trim|9","base|4"],3]out["base","trim"]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.
[["panel-a|40","panel-b|15","panel-c|30"],20]["panel-b","panel-a","panel-c"]not run yetsample[["door|10","shelf|10","lid|10"],25]["door","shelf","lid"]not run yetsample[["trim|9","base|4"],3]["base","trim"]not run yetsample