#C1288. Can Attend All Meetings
Can Attend All Meetings
Can Attend All Meetings
You are given ( n ) meetings with their start and end times. The ( i )-th meeting is represented as an interval ( [s_i, e_i] ). Determine if a person can attend all meetings without any overlapping. Two meetings ( [s_i, e_i] ) and ( [s_j, e_j] ) are considered non-overlapping if ( e_i \leq s_j ).
It is guaranteed that the input data will be such that the solution can be computed in a straightforward manner by sorting the meetings based on their start times.
inputFormat
The input is given via standard input (stdin). The first line contains an integer ( n ) representing the number of meetings. Each of the next ( n ) lines contains two space-separated integers ( s_i ) and ( e_i ), representing the start and end times of the meeting. If ( n = 0 ), there are no meeting lines that follow.
outputFormat
Print to standard output (stdout) a single line containing either ( 'True' ) if a person can attend all meetings without any overlaps, or ( 'False' ) otherwise.## sample
3
0 30
5 10
15 20
False