Given a list of meetings with start and end times, determine the minimum number of meeting rooms required to accommodate all the meetings. The start and end times of the meetings are represented as tuples (start_time, end_time).

Function Signature:

from typing import List, Tuple

def min_meeting_rooms(meetings: List[Tuple[int, int]]) -> int:
    """
    Determine the minimum number of meeting rooms required.

    Parameters:
    - meetings: A list of tuples representing start and end times of meetings.

    Returns:
    - int: The minimum number of meeting rooms required.
    """
    # Your code here

Example:

result1 = min_meeting_rooms([(0, 30), (5, 10), (15, 20)])
print(result1)
assert result1 == 2
# Explanation: Two meeting rooms are required, as the first meeting overlaps with the other two.

result2 = min_meeting_rooms([(1, 5), (8, 9), (2, 6)])
print(result2)
assert result2 == 2
# Explanation: Two meeting rooms are required, as the first and third meetings overlap.

result3 = min_meeting_rooms([(7, 10), (2, 4)])
print(result3)
assert result3 == 1
# Explanation: Only one meeting room is required, as the meetings do not overlap.

Note:

  • The input meetings are not sorted.
  • The start time of a meeting is strictly less than its end time.

Instructions:

  • Write the min_meeting_rooms function to solve the problem.
  • Implement your solution in Python.
  • Provide clear comments in your code.
  • Discuss the time and space complexity of your solution.

As always, we’ll share our solution to this problem tomorrow. Stay tuned 😊