Code RoomMaximum profit non-overlapping jobs
MediumPrep Room Coding #845

Maximum profit non-overlapping jobs

CodingAlgorithms & data structuresMid–Senior~30 min

You are given jobs as a list of [start, end, profit]. You can do at most one job at a time (a job occupies [start, end), so a job starting exactly when another ends is allowed). Return the maximum total profit of a non-overlapping subset. 1 <= len(jobs) <= 5*10^4, 1 <= start < end <= 10^9, 1 <= profit <= 10^4.

Implement
max_job_profit(jobs: list[list[int]]) → int
Examples
in[[[1,3,50],[3,5,20],[6,19,100],[2,100,200]]]out200
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 30 min
InputExpectedGot
[[[1,3,50],[3,5,20],[6,19,100],[2,100,200]]]200not run yetsample