#C4786. Meeting Scheduler
Meeting Scheduler
Meeting Scheduler
You are given a series of meeting time intervals represented by their start and end times. Two meetings are considered non-overlapping if the end time of one meeting is less than or equal to the start time of the next meeting. In other words, if one meeting ends exactly when the next one begins, they do not conflict.
The goal is to determine if a person can attend all the meetings without any scheduling conflicts.
Note: It is guaranteed that \(0 \leq start < end\) for each meeting. The meetings might not be provided in sorted order.
Input: The first line of input contains an integer \(n\) representing the number of meetings. Each of the next \(n\) lines contains two space-separated integers representing the start and end times of a meeting.
Output: Output True
if all meetings can be attended (i.e. there is no overlap between any two meetings), otherwise output False
.
inputFormat
The first line contains an integer n, denoting the number of meetings. Each of the following n lines contains two space-separated integers, where the first integer is the start time and the second integer is the end time of a meeting. If n is 0, then there are no meetings.
outputFormat
Output a single line with either 'True' or 'False'. 'True' indicates that it is possible to attend all meetings without any overlap, while 'False' indicates that at least two meetings overlap.## sample
2
7 10
2 4
True