Code RoomJobs exceeding duration limit
MediumPrep Room Coding #511

Jobs exceeding duration limit

CodingAlgorithms & data structuresEntry–Mid~13 min

A CI system logs "<job> <ts> START" when a job begins and "<job> <ts> END" when it finishes, with ts as integer Unix seconds. Runs of different jobs interleave freely, but each job name appears exactly once as START and exactly once as END, with the END timestamp later. Given the log lines (chronological) and a duration limit in seconds, return the names of all jobs whose run took STRICTLY longer than the limit, sorted alphabetically.

Implement
overrunning_jobs(lines: list[str], limit: int) → list[str]
Examples
in[["nightly-backup 100 START","report-gen 120 START","report-gen 200 END","nightly-backup 700 END"],300]out["nightly-backup"]
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 13 min
InputExpectedGot
[["nightly-backup 100 START","report-gen 120 START","report-gen 200 END","nightly-backup 700 END"],300]["nightly-backup"]not run yetsample