Train platform minimum count
Your task
Given arrival and departure times of trains at a station (arrivals[i] and departures[i] belong to train i, arrival <= departure), return the minimum number of platforms needed so that no train waits. A platform freed at the exact departure time may be reused by a train arriving at that same time. Both lists have equal length and may be empty.
Examples
min_platforms(arrivals: list[int], departures: list[int]) -> intExample 1
Input
min_platforms([900, 940, 950, 1100, 1500, 1800], [910, 1200, 1120, 1130, 1900, 2000])Output
3