Description
1. Merge Meetings Times

Your company uses a meeting management system to book meetings throughout the day. Unfortunately, the system does not consolidate overlapping or consecutive meetings, leading to confusion and inefficiency. Your task is to write a function that merges overlapping and consecutive meeting times to streamline the meeting schedule.

Given a list of meeting times represented as tuples of start and end times (start, end) (in 24-hour format), your function should return a new list with the overlapping and consecutive meetings merged. A meeting is considered to overlap if it starts before another meeting ends. Consecutive meetings have no gap between them.

Example 1

Input:  [[0, 1], [3, 5], [4, 8], [10, 12], [9, 10]]
Output: [[0, 1], [3, 8], [9, 12]]

Example 2

Input:  [[1, 2], [2, 3]]
Output: [[1, 3]]
Constraints:
  • 0 <= start < end <= 24
  • The number of meetings will be at least 1 and at most 10^4.
  • Meetings will be represented by their start and end times, with no two meetings having the same start time.
Test Cases

Case 1
Case 2

Input

[[0, 1], [3, 5], [4, 8], [10, 12], [9, 10]]

Output

[[0, 1], [3, 8], [9, 12]]