Write a function to find the minimum number of platforms required at a train station given arrival and departure times of trains
HardProblem Statement
Write a function to find the minimum number of platforms required at a train station given arrival and departure times of trains
Sample Input
arr = [900, 940, 950, 1100, 1500, 1800], dep = [910, 1200, 1120, 1130, 1900, 2000]
Sample Output
3
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
import java.util.*;
public class Main {
public static int findPlatform() {
int[] arr = {900, 940, 950, 1100, 1500, 1800};
int[] dep = {910, 1200, 1120, 1130, 1900, 2000};
// Your code here
return 0;
}
}
Input
arr = [900, 940, 950, 1100, 1500, 1800], dep = [910, 1200, 1120, 1130, 1900, 2000]
Expected Output
3