Code RoomJob scheduling with pickup deadlines
EasyPrep Room Coding #4853

Job scheduling with pickup deadlines

CodingAlgorithms & data structuresEntry–Mid~18 min

A print shop runs one press. job_names lists the jobs waiting, every name is distinct and no name holds a comma or a space. run_minutes[i] is how long job i occupies the press and pickup_minutes[i] is the minute a courier collects that job, both counted from the moment the press starts. The press works the jobs one after another with no gaps, starting at minute 0, and a job is on time when it finishes at or before its own pickup minute. Every job must run. Return the running order that keeps every job on time, written as the job names joined by a comma and a space. When more than one order works, return the one that comes first alphabetically, comparing the orders job by job. Return an empty string when no order works, and when there are no jobs. There are at most 7 jobs and every minute given is positive.

Implement
on_time_press_order(job_names: list[str], run_minutes: list[int], pickup_minutes: list[int]) → str
Examples
in[["a","b","c"],[3,5,2],[10,5,12]]out"b, a, c"
in[["cards","banner"],[15,15],[15,20]]out""
in[["flyer","poster"],[20,10],[30,40]]out"flyer, poster"
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 18 min
InputExpectedGot
[["a","b","c"],[3,5,2],[10,5,12]]"b, a, c"not run yetsample
[["cards","banner"],[15,15],[15,20]]""not run yetsample
[["flyer","poster"],[20,10],[30,40]]"flyer, poster"not run yetsample