Given an array of meeting time intervals where intervals[i] = [start_i, end_i], return the minimum number of conference rooms required.
Key insight: We need to find the maximum number of overlapping meetings at any point in time. This can be solved using:
Min-heap approach: Sort by start time. Use a min-heap to track meeting end times. For each meeting, remove all ended meetings, then add the current one.
Event-based approach: Create separate arrays for start and end times. Sort both. Use two pointers to count active meetings.
Sweep line: Mark +1 at each start, -1 at each end. The maximum running sum is the answer.
Real-world analogy: You're a facility manager figuring out how many conference rooms to book for a day's meetings.
intervals = [[0,30],[5,10],[15,20]]2intervals = [[7,10],[2,4]]1intervals = [[1,5],[2,6],[3,7],[4,8]]41 <= intervals.length <= 10^40 <= start_i < end_i <= 10^6Click "Run" to execute your code against test cases
Socratic guidance - I'll ask questions, not give answers