Meeting Rooms II
Beginner Mode

Problem Statement

Given an array of meeting time intervals intervals where intervals[i] = [starti, endi], return the minimum number of conference rooms required to hold all the meetings without any overlaps.

Note that meetings ending and starting at the exact same time (e.g., [1, 2] and [2, 3]) are not considered overlapping and can share the exact same conference room.

Additional information

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

Example 1:

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

Output: 2

Explanation: - Room 1: [0,30]

  • Room 2: [5,10] and [15,20]
    Since the meeting [0,30] spans across the duration of both other meetings, we need at least 2 conference rooms.

Example 2:

Input: intervals = [[7,10],[2,4]]

Output: 1

Explanation: The meetings do not overlap at all, so they can be held sequentially in a single conference room.

Quick Solution

Code Environment

Sign in or try as guest to run your code.

Sign In

Track

Question Difficulty Company Access
Need more practice in this area? Explore more questions →