With multiple overlapping train arrivals expected during a university trip, Mitu needs to know the MINIMUM number of platforms required so no train has to wait. Given arrival and departure times of N trains at a station, find the MINIMUM number of platforms required so that no train waits.
Input
Line1: N. Line2: N arrival times. Line3: N departure times.
Output
Minimum platforms needed.
Constraints
1 ≤ N ≤ 10^5
Sample Input
3 900 940 950 910 1200 1120
Sample Output
2
main.c
Loading editor…
Write C, then Run (custom I/O) or Submit (sample tests). ⌘/Ctrl+Enter submits.