74. Activity Selection (Max Non-Overlapping Intervals)
MediumGreedy
Each activity is [start, end]. Return the maximum number of activities one person can do if they cannot overlap. An activity may start exactly when another ends.
Example 1
Input: intervals = [[1, 2], [3, 4], [0, 6], [5, 7], [8, 9], [5, 9]] Output: 4
Constraints
1 ≤ intervals.length ≤ 10⁵