Skip to main content
Medium Greedy High frequency

Meeting Rooms II

Approach Summary

Sort by start. Min-heap of end times: if next meeting starts after earliest end, reuse that room (pop & push new end), else add a room.

How to Recognize This Pattern

  • "Minimum rooms for all meetings"
  • Min-heap of end times represents available room endings

Complexity Analysis

Time Complexity

O(n log n)

Space Complexity

O(n)

Tags

Array Greedy Sorting Heap

This site is free. If these guides are helping your prep, consider buying me a coffee. ☕

Support →
Buy me a coffee