#C2550. Meeting Overlap Checker

    ID: 45879 Type: Default 1000ms 256MiB

Meeting Overlap Checker

Meeting Overlap Checker

You are given ( n ) meeting intervals, where each interval is described by its start and end times. Determine whether a person can attend all meetings without any overlaps. After sorting the intervals by start time, if for any two consecutive intervals ( [s_{i-1}, e_{i-1}] ) and ( [s_i, e_i] ), it holds that ( s_i < e_{i-1} ), then the meetings overlap.

For example, given the intervals:
Input: 2\n7 10\n2 4
Output: True

inputFormat

The first line contains an integer ( n ), the number of meetings. Each of the next ( n ) lines contains two space-separated integers representing the start and end times of a meeting.

outputFormat

Output a single line with True if the person can attend all meetings without any overlaps, otherwise output False.## sample

2
7 10
2 4
True