193. Meeting Rooms II

MediumIntervals

Given an array of meeting time intervals where intervals[i] = [starti, endi], return the minimum number of conference rooms required. You must allocate rooms such that no two overlapping meetings share the same room.

Examples

Input: [[0,30],[5,10],[15,20]]

Output: 2

Explanation: We need two rooms: one for [0,30] and one for [5,10] then [15,20].

Constraints

  • 1 <= intervals.length <= 10^4
  • 0 <= starti < endi <= 10^6
Loading...

Run checks all cases above. Submit evaluates all test cases.