Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Function to find the minimum number of platforms required at the
- #railway station such that no train waits.
- def minimumPlatform(n,arr,dep):
- i=0
- j=0
- arr.sort()
- dep.sort()
- res=pf=0
- while i<n and j<n:
- if arr[i]<=dep[j]:
- i=i+1
- pf+=1
- res=max(pf,res)
- else:
- j=j+1
- pf-=1
- return res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement