Skip to content
C

Minimum Platforms

Mediumjavapythonccppjavascript

Given the arrival and departure times of N trains at a station, find the minimum number of platforms needed so that no train waits. A platform is needed if a train arrives before or at the same moment another departs.

Input Format

The first line contains an integer N. The second line contains N space-separated integers — the arrival times. The third line contains N space-separated integers — the departure times.

Output Format

Print the minimum number of platforms required.

Input (stdin)

Output

Run your code to see output here...