Train platform minimum count
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.
Implement
min_platforms(arrivals: list[int], departures: list[int]) → intExamples
in
[[900,940,950,1100,1500,1800],[910,1200,1120,1130,1900,2000]]out3What a strong answer looks like
State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
0:00 of about 20 min
solution.py
InputExpectedGot
[[900,940,950,1100,1500,1800],[910,1200,1120,1130,1900,2000]]3not run yetsample