Train platform minimum count

Write codeMedium20 min

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]) -> int
Example 1
Inputmin_platforms([900, 940, 950, 1100, 1500, 1800], [910, 1200, 1120, 1130, 1900, 2000])
Output3