Skip to main content
hardGrind 75

Maximum Profit in Job Scheduling

Given startTime, endTime, and profit arrays for n jobs Return the maximum profit you can take such that no two jobs overlap If a job ends at time X, another job can start at time X Example: startTime = [1,2,3,3], endTime = [3,4,5,6], profit = [50,10,40,70] => 120

Sort by end time, then each job asks one question: what was the best profit before I could start? I binary search for it.

Arrays & HashingBinary SearchDynamic Programming

Meet Coco

Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix. Typing with Coco is free when you sign in, up to a daily limit. Talking with her out loud comes with the $79 pack. Anyone can open the editor and run their code.

1Maximum Profit Job Schedulinghard
Based onLeetCode