Created
May 11, 2022 15:58
-
-
Save bhavjot/3d9e688607b2cd555937ca7a621e4a5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int findPlatform(int[] arr, int[] dep,int n) | |
{ | |
//code here | |
Array.Sort(arr); | |
Array.Sort(dep); | |
var noOfPlatforms = 0; | |
var i = 0; | |
var j = 0; | |
while (i<n){ | |
if(arr[i]<=dep[j]){ | |
noOfPlatforms++; | |
} | |
else{ | |
j++; | |
} | |
i++; | |
} | |
return noOfPlatforms; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment