algorythms
Merge Intervals
LC #253Medium

Meeting Rooms II

Merge Intervals
AmazonGoogleMetaBloombergMicrosoft

Problem

Find the minimum number of conference rooms required to hold all meetings.

arrayheapsortingmerge-intervals

Constraints

  • 1 ≤ n ≤ 10⁴
  • 0 ≤ startᵢ < endᵢ ≤ 10⁶

Example

Inputintervals = [[0,30],[5,10],[15,20]]
Output2
Why

Room 1: [0,30]. Room 2: [5,10] then [15,20]. Need 2 rooms minimum

Hints — reveal one at a time