Fetching algorithms...
GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing rulcode.com — Activity Selection Visualizer & Solution | Rulcode Fetching algorithms... Loading problem details... 37. Activity SelectionMedium Topics Hint Understand Before CodingVisualize This ProblemOpen Visualizer Draw Your ApproachDraw Example 1:Input: intervals = [[1,2],[2,3],[3,4],[1,3]]Output: 1Explanation: [1,3] overlaps with [1,2], [2,3], [3,4]. Remove [1,3] to obtain non-overlapping intervals. Example 2:Input: intervals = [[1,2],[1,2],[1,2]]Output: 2Explanation: You need to remove two [1,2] to make the rest of the intervals non-overlapping. Example 3:Input: intervals = [[1,2],[2,3]]Output: 0Explanation: You don't need to remove any of the intervals since they are already non-overlapping. Example 4:Input: intervals = [[1,100],[11,22],[1,11],[2,12]]Output: 2Explanation: Optimal solution involves removing [1,100] and either [1,11] or [2,12]. Example 5:Input: intervals = []Output: 0Explanation: Empty input should return 0 as there are no intervals to remove. Constraints:
Time Complexity O(n log n) Space Complexity O(1) |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |