Problem
Job i runs from start_time[i] to end_time[i] and pays profit[i]. Choose a set of jobs with no two overlapping and return the maximum total profit. A job that ends at time X does not overlap one that starts at X.
Example 1
start_time = [1, 2, 3, 3], end_time = [3, 4, 5, 6], profit = [50, 10, 40, 70]
Example 2
→ 120 (jobs [1, 3] and [3, 6])
Example 3
start_time = [1, 1, 1], end_time = [2, 3, 4], profit = [5, 6, 4]
Example 4
→ 6
Constraints
1 <= n <= 5 * 10^4, where n is the number of jobs1 <= start_time[i] < end_time[i] <= 10^91 <= profit[i] <= 10^4