Back to Practice Dashboard
Top 150 InterviewEasy

Meeting Rooms II

Learn how to solve the 'Meeting Rooms II' problem. This detailed resource details brute force and optimized approaches.

Problem Statement

Easy

Given an array of meeting time intervals intervals where intervals[i] = [starti, endi], find the minimum number of conference rooms required.

Write a function minMeetingRooms(intervals: List[List[int]]) -> int.

Constraints
  • 0 <= len(intervals) <= 10^4
  • intervals[i].length == 2
  • 0 <= starti < endi <= 10^6

Examples

Example 1
Input
intervals = [[0,30],[5,10],[15,20]]
Output
2
Explanation

Room 1: [0,30], Room 2: [5,10], [15,20].

Example 2
Input
intervals = [[7,10],[2,4]]
Output
1
Explanation

Meetings do not overlap.

Need a Hint?
Analyze the input constraints. Try sorting first (O(n log n)) or using a hash map/set to track seen elements in O(n) time.
Edge Cases to Watch
  • Empty list or null input variables
  • Single item lists/arrays
  • Extremely large input bounds causing integer or stack overflow

Ready to Solve?

Open the problem in PyRun's browser-based Python editor. Your code runs fully offline — no server required.

Open in Editor