PythiloMedium · 25 min · Task 82 of 100 · progress kept in this browser

Count meeting rooms

Return the fewest rooms for positive-length half-open meeting intervals [start,end). A meeting may start when another ends.

import heapq
active_ends = [3, 7]
next_start = 3
while active_ends and active_ends[0] <= next_start:
    heapq.heappop(active_ends)
print(active_ends)
Your task

Return the fewest rooms for positive-length half-open meeting intervals [start,end). A meeting may start when another ends.