#K34687. Maximum Overlapping Attendees
Maximum Overlapping Attendees
Maximum Overlapping Attendees
You are given a set of events, where each event represents an attendee's available time with a start and an end time. Two events overlap if one starts before the other ends. Your task is to compute the maximum number of attendees that can be present at the same time.
The input begins with an integer n specifying the number of events. Each of the following n lines contains two integers denoting the start time and the end time of an event.
Note: When an event ends at time t and another starts at time t, they are not considered overlapping.
Your answer should be computed using an efficient algorithm.
inputFormat
The first line of input contains a single integer n (1 ≤ n ≤ 105), representing the number of events. The next n lines each contain two space-separated integers start and end (0 ≤ start < end ≤ 109) representing the availability time of an attendee.
outputFormat
Output a single integer which is the maximum number of attendees present simultaneously.
## sample4
1 5
2 6
5 8
3 7
3