Blind 75
67 / 75Free practice

Meeting Rooms II

Medium · Intervals

On LeetCode, Meeting Rooms II needs LeetCode Premium (checked October 2026). Here it is free: run and submit in Python, JavaScript, Java or C++ with a free account.

Jump to code

Find the minimum rooms needed for meeting intervals with start < end. A room becomes reusable at the meeting’s end time.

Examples

Example 1

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

Output: 2

Example 2

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

Output: 1

Constraints

  • 0 <= intervals.length <= 500
  • 0 <= intervals[i].start < intervals[i].end <= 1,000,000
Need a hint?

The answer is the largest number of simultaneous active meetings.

Asked in real interviews

Candidates reported versions of Meeting Rooms II from these company interviews. Some company questions are locked and open with Premium or XP.

Browse all real coding interview questions

Accepted submissions mark this problem complete. Progress stays in this browser.

Run checks 5 examples. Submit checks all 9 cases. A free account runs this problem; no XP needed.
Language
Case 1
Input
[
  [
    [
      0,
      30
    ],
    [
      5,
      10
    ],
    [
      15,
      20
    ]
  ]
]
Expected
2
Case 2
Input
[
  [
    [
      7,
      10
    ],
    [
      2,
      4
    ]
  ]
]
Expected
1
Case 3
Input
[
  [
    [
      1,
      4
    ],
    [
      2,
      5
    ],
    [
      3,
      6
    ]
  ]
]
Expected
3
Case 4
Input
[
  [
    [
      1,
      2
    ],
    [
      2,
      3
    ],
    [
      3,
      4
    ]
  ]
]
Expected
1
Case 5
Input
[
  [
    [
      1,
      3
    ],
    [
      2,
      4
    ],
    [
      5,
      6
    ]
  ]
]
Expected
2

Drafts are saved per language in this browser when storage is available.