#K41822. Meeting Scheduler: Can Attend All Meetings?

    ID: 26951 Type: Default 1000ms 256MiB

Meeting Scheduler: Can Attend All Meetings?

Meeting Scheduler: Can Attend All Meetings?

You are given a list of meetings time intervals where each interval is represented by a pair of integers \( (s, e) \) indicating the start time and end time of a meeting. Determine if a person can attend all meetings without any overlapping meetings.

More formally, given \( n \) intervals sorted by their starting times, if for any two consecutive meetings \( (s_i, e_i) \) and \( (s_{i+1}, e_{i+1}) \) the condition \( s_{i+1} < e_i \) holds, the meetings overlap. Otherwise, all meetings can be attended.

Note: If there are no meetings, the answer is True.

inputFormat

The first line contains a single integer \( n \) which represents the number of meetings. Each of the next \( n \) lines contains two space-separated integers \( s \) and \( e \) representing the start and end times of a meeting.

Constraints:

  • \( 0 \leq n \leq 10^5 \)
  • \( 0 \leq s < e \leq 10^9 \)

outputFormat

Print True if a person can attend all meetings without any overlap, or False otherwise.

## sample
0
True