FrontendInterviews.dev

Loading problem…

290. Meeting Rooms II

Medium•
Acceptance: 76.92%
•
🔓3/3 Pro unlocks today

This problem builds on meeting-rooms. Complete that first, then load your solution to continue.

Given an array of meeting time intervals where intervals[i] = [start, end], return the minimum number of conference rooms required.

Requirements

Implement:

function minMeetingRooms(intervals) {}

Example Usage

minMeetingRooms([
  [0, 30],
  [5, 10],
  [15, 20],
]); // 2

minMeetingRooms([
  [7, 10],
  [12, 15],
]); // 1

Constraints

  • 0 <= intervals.length <= 10^4
  • 0 <= start < end <= 10^6
  • Need better than O(n^2) for large input