Solution: Maximum Profit in Job Scheduling
Let's solve the Maximum Profit in Job Scheduling problem using the Dynamic Programming pattern.
Statement
Suppose there are startTime
, endTime
, and profit
, calculate the maximum profit that can be obtained.
Note: Selecting a job that finishes at time
means you can pick the next job that starts at the same time or later.
Constraints:
startTime.length
endTime.length
profit.length
startTime[i]
endTime[i]
...