Marks :15
: 3 | : 1
Given arrival and departure times of all trains that reach a railway station. Find the minimum number of platforms required for the railway station so that no train is kept waiting.
First line contains n (number of trains) where ($$$1\le n \le 200000$$$).
Second line contains n space separated integers $$$A_i$$$ (Arrival time of $$$ith$$$ train) such that ($$$1 \le A_i \le 1e6$$$).
Third line contains n space separated integers $$$B_i$$$ (Departure time of $$$ith$$$ train) such that ($$$1 \le B_i \le 1e6$$$).
Print a single integer denoting the number platforms we needed such that no train have to wait.
6 900 940 950 1100 1500 1800 910 1200 1120 1130 1900 2000
3
4 100 200 300 400 200 300 400 500
2
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log In
Your challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.