The Question
CodingMinimum Number of Railway Platforms
Given two arrays representing the arrival and departure times of all trains reaching a station, calculate the minimum number of platforms required so that no train is kept waiting.
Constraints and Details:
1. All trains arrive and depart on the same day.
2. Times are provided in 24-hour format (HHMM).
3. If a train arrives at the same time another train departs, they cannot share the same platform; a separate platform is required for the arriving train.
4. Input arrays
Arrival and Departure are of size $N$.
Example:
Input: Arrival = [900, 940, 950, 1100, 1500, 1800], Departure = [910, 1200, 1120, 1130, 1900, 2000]
Output: 3C++
Two-Pointer
Greedy
Sorting