← 返回 walmartlabs 的题目列表Meeting Schedule / Meeting Rooms (Hackerrank)
类型:online_judge
Problem: Meeting Schedule ("schedule meeting")
Given a list of meeting time intervals intervals, where each interval is [start, end) with start < end, representing a meeting that starts at start and ends at end.
Implement a function to compute the minimum number of meeting rooms required to hold all meetings without conflicts.
Input
The first line contains an integer n, the number of meetings.
The next n lines each contain two integers start end.
Output
Print one integer: the minimum number of meeting rooms required.
Constraints
1 <= n <= 2 * 10^5
0 <= start < end <= 10^9
Example
Input:
3
0 30
5 10
15 20
Output:
2
Example
Input
3
0 30
5 10
15 20
Output
2