#1070Hard#16 in Pinterest's list· asked at 12 companies
Maximum Profit in Job Scheduling
Hosted on LeetCode
Solve it on LeetCode, track it here.
This problem's full statement lives on LeetCode. Open it in a new tab, then come back to mark it solved, add notes and keep your streak.
LeetCode Premium locked?
Most company-tagged LeetCode problems are behind Premium. If you have ChatGPT Plus or Claude Pro, ask it for the full statement, examples and constraints. The buttons below open a chat with the prompt already filled in.
What we know
Example 1
Input: startTime = [1,2,3,3], endTime = [3,4,5,6], profit = [50,10,40,70] Output: 120
Take jobs 1 and 4 (times [1,3] and [3,6]).
Example 2
Input: startTime = [1,2,3,4,6], endTime = [3,5,10,6,9], profit = [20,20,100,70,60] Output: 150
Example 3
Input: startTime = [1,1,1], endTime = [2,3,4], profit = [5,6,4] Output: 6
Constraints
- •
1 <= startTime.length == endTime.length == profit.length <= 5 * 10^4 - •
1 <= startTime[i] < endTime[i] <= 10^9 - •
1 <= profit[i] <= 10^4