MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / hotel

Function hotel

InterviewBit_problems/Sorting/Hotel Booking/solution.py:13–19  ·  view source on GitHub ↗
(arrive, depart, K)

Source from the content-addressed store, hash-verified

11- But if no arrive date is less than depart date then there are enough rooms for N bookings and hence returning True
12'''
13def hotel(arrive, depart, K):
14 arrive.sort()
15 depart.sort()
16 for i in range(len(arrive)):
17 if i+K<len(arrive) and arrive[i+K]<depart[i]:
18 return False
19 return True
20
21if __name__=="__main__":
22

Callers 1

solution.pyFile · 0.85

Calls 1

sortMethod · 0.80

Tested by

no test coverage detected