← 返回 pinterest 的题目列表Weighted Job Scheduling for Maximum Profit Without Overlaps
类型:online_judge
pinterest
Given a set of jobs, where each job has a start time, end time, and profit, find the maximum profit you can achieve without overlapping. You may choose not to do any job. The constraint is that the number of jobs does not exceed 50000. Implement an efficient algorithm to solve this problem. Here’s an example:
Input: startTime = [1, 2, 3, 3], endTime = [3, 4, 5, 6], profit = [50, 10, 40, 70]
Output: 120
Explanation: Select jobs 1 and 4 for a total profit of 120.
Example
Input
1
[1, 2, 3, 3]
[3, 4, 5, 6]
[50, 10, 40, 70]