← 返回 google 的题目列表Meeting Rooms / Meeting Rooms II (interval scheduling) with large-input follow-up
类型:online_judge
Given meeting intervals intervals[i] = [start_i, end_i), return the minimum number of conference rooms required so that no overlapping meetings share the same room.
Requirements:
Input: n intervals, 1 <= n <= 2 * 10^5 (discuss larger scale in follow-up).
Output: minimum number of rooms.
Follow-up (very large input): If n is extremely large such that it may not fit in memory, or sorting is the bottleneck, how would you adapt the solution (e.g., streaming, chunking/external sort, I/O optimizations, distributed aggregation)?
Example
Input
3
0 30
5 10
15 20
Output
2