← 返回 bytedance 的题目列表Meeting Rooms II
类型:online_judge
Given an array of meeting intervals intervals, where intervals[i] = [start_i, end_i] represents the start and end time of meeting i, return the minimum number of meeting rooms required to hold all meetings.
If one meeting ends at time t and another starts at time t, they may use the same room.
Input Format
First line: an integer n, the number of meetings.
Next n lines: two integers start end, representing a half-open interval [start, end).
Output Format
Print one integer: the minimum number of rooms required.
Example 1
Input:
3
0 30
5 10
15 20
Output:
2
Example 2
Input:
3
7 10
2 4
10 12
Output:
1
Constraints
1 <= n <= 200,000
0 <= start_i < end_i <= 10^9
Example
Input
3
0 30
5 10
15 20
Output
2