#253
Meeting Rooms II
medium· Intervalsruns: 0Given an array of meeting time intervals where intervals[i] = [start_i, end_i], return the minimum number of conference rooms required to hold all meetings without overlap.
sign in to paste and practice your own solution
wpm 0acc 100%time 0:000 / 331
import heapq
class Solution:
def minMeetingRooms(
self, intervals: list[list[int]]
) -> int:
intervals.sort()
heap = []
for start, end in intervals:
if heap and heap[0] <= start:
heapq.heappop(heap)
heapq.heappush(heap, end)
return len(heap)
click the box to focus · tab inserts 4 spaces · backspace to correct · esc to pause
desktop only
codedrill is a typing game and needs a real keyboard. open this on a laptop or desktop to practice.
you can still browse problems and sections from your phone.