You are given the arrival and departure times for n trains at a railway station. Find the minimum number of platforms the railway station needs so that none of the trains have to wait.
The time is given in minutes from midnight. All trains have departures on the same day.
Trains (arrival, departure): [(120, 130), (130, 150), (125, 145), (150, 180)]
Output: 3
Explanation: At 2:10 AM (130th minute), there are 3 trains at the station.
The first line contains an integer ‘T’ denoting the number of test cases.
For each test case, the input contains the following lines:
One line for each test case, with the minimum number of platforms required.
2
4
120 130
130 150
125 145
150 180
7
360 400
320 380
260 320
210 250
420 450
440 480
370 420
3
3
1 <= t <= 10
1 <= n <= 5*104
0 <= arrivali < departurei < 1440