← 返回 walmartlabs 的题目列表Minimum Meeting Rooms Required
类型:online_judge
Problem: Minimum Meeting Rooms Required
Given n meetings with start and end times, return the minimum number of meeting rooms required to schedule all meetings.
Each meeting is represented as a half-open interval [start, end): a meeting ending at time end does not overlap with another meeting starting exactly at end, so they may use the same room.
Input Format
The first line contains an integer n, the number of meetings.
The next n lines each contain two integers, start end, representing [start, end).
Output Format
Print one integer: the minimum number of required meeting rooms.
Constraints
1 <= n <= 2 * 10^5
0 <= start < end <= 10^9
Example 1
Input:
3
0 30
5 10
15 20
Output:
2
Example 2
Input:
2
7 10
10 12
Output:
1
Example
Input
3
0 30
5 10
15 20
Output
2