Answer to Question #289517 in Python for Bubby

Question #289517

Minimum Platforms

You are 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.

Consider that all the trains arrive on the same day and leave on the same day. Arrival and departure time can never be the same for a train but we can have the arrival time of one train equal to the departure time of the other. At any given instance of time, the same platform can not be used for both departures of a train and the arrival of another train. In such cases, we need different platforms.

Input:

The first line contains space-separated integers that represent the arrival time of the trains.

The second line contains space-separated integers that represent the corresponding end time(24-hour format) of the trains.

Output:

The output should have an integer that represents the number of platforms needed to arrange the commute of all the trains.


Sample Input 1:

0900 1100 1235

1000 1200 1240

Sample Output 1:

1




1
Expert's answer
2022-01-21T08:23:31-0500
Dear Bubby, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS