Merge Intervals
LC #253Medium
Meeting Rooms II
Merge Intervals
AmazonGoogleMetaBloombergMicrosoftProblem
Find the minimum number of conference rooms required to hold all meetings.
arrayheapsortingmerge-intervals
Constraints
- ›1 ≤ n ≤ 10⁴
- ›0 ≤ startᵢ < endᵢ ≤ 10⁶
Example
Input
intervals = [[0,30],[5,10],[15,20]]Output
2Why
Room 1: [0,30]. Room 2: [5,10] then [15,20]. Need 2 rooms minimum