Back to Practice
#0257

Minimum Meeting Rooms

MediumDSA28 min20 XP

Problem

Given meeting intervals [start, end], return the minimum number of rooms needed. A meeting ending at t frees a room for another starting at t.

Why This Matters

This is the practical scheduling upgrade after overlap detection: count concurrent active intervals.

Function Signature

def min_meeting_rooms(intervals):

Examples

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

The long meeting overlaps with both shorter meetings, so two rooms are enough.

Constraints

  • Return the exact requested value.
  • Handle edge cases cleanly.
  • Use the intended DSA pattern when brute force would scale poorly.
CodePython
Visible browser tests run here when available.
Testcases2 visible / 3 hidden categories
Two rooms needed
Input[[0,30],[5,10],[15,20]]
Expected2

At most two meetings run at the same time.

Back-to-back meetings
Input[[7,10],[2,4],[4,7]]
Expected1

Each meeting frees the room before the next starts.

Hidden Test Categories
empty intervalsall meetings overlapmany meetings with same start