You're given a list of call records.
Each call record has a start time and an end time in seconds from epoch — both integers.
We want to find the maximum number of concurrent active calls at any single point in time.
For example, if three calls are all active simultaneously at second 5000, the answer is 3.
Write a function that takes this list and returns the maximum concurrency.
---------------------------------------------------
Starter Code Template:
from typing import List, Tuple
def max_concurrent_calls(calls: List[Tuple[int, int]]) -> int:
"""
Args:
calls: List of (start_time, end_time) tuples, times in epoch seconds.
Returns:
Maximum number of calls active simultaneously at any point.
"""
# Your implementation here
pass
# Test cases
if __name__ == "__main__":
test1 = [(1, 5), (2, 6), (4, 8)] # Expected: 3
test2 = [(1, 2), (3, 4), (5, 6)] # Expected: 1
test3 = [(1, 10), (2, 10), (3, 10)] # Expected: 3
test4 = [(5, 5)] # Expected: 1
test5 = [] # Expected: 0
for i, tc in enumerate([test1, test2, test3, test4, test5], 1):
print(f"Test {i}: {max_concurrent_calls(tc)}")0 views