Each meeting is a pair (start, end) with start < end, covering start up to but not including end: a meeting ending at 10 and one starting at 10 do not clash.
Write can_attend_all(meetings: list[tuple[int, int]]) -> bool: True if one person could attend every meeting. The meetings are in no particular order.
can_attend_all([(9, 10), (13, 14), (10, 12)]) # True (10 ends one and starts the next)
can_attend_all([(1, 5), (8, 9), (4, 6)]) # False ((1, 5) and (4, 6) share time 4..5)
can_attend_all([]) # True
Up to 10^5 meetings, times between -10^9 and 10^9.
⭐ Bonus: a speed test with 100,000 meetings earns a star in O(n log n). Comparing every pair is O(n²).
Show hint
sort by start time; then any overlap shows up between two neighbours.