Related: Weighted Interval Scheduling Activity Selection
Danger
I have a lot of ideas, but the main issues are:
- I am trying to do recursion as follows:
- Get the intervals which overlap, and for each of those, compute their local cost (cost considering the rest of the intervals costs).
- But I am unable to figure out how to use a DFS-like algorithm without causing infinite calls.
References
https://leetcode.com/problems/maximum-profit-in-job-scheduling/