#K71847. Meeting Overlap Checker
Meeting Overlap Checker
Meeting Overlap Checker
You are given a list of meeting time intervals, where each interval is represented by two integers denoting the start and end times. A meeting interval is represented as \( [s, e] \), where \( s \) is the start time and \( e \) is the end time. Two meetings \( [s_1, e_1] \) and \( [s_2, e_2] \) are considered overlapping if \( s_2 < e_1 \).
Your task is to determine whether a person can attend all the meetings without any overlaps.
Note: If there are no meetings, the answer is true.
inputFormat
The input is read from stdin and has the following format:
n s1 e1 s2 e2 ... sn en
Here, n
(an integer) represents the number of meetings. Each of the following n
lines contains two space-separated integers s
and e
representing the start and end times of a meeting respectively.
outputFormat
Output a single line to stdout containing either true
or false
. Output true
if the person can attend all meetings without any overlap; otherwise, output false
.
2
7 10
2 4
true