hotel bytelandia easy

In this problem

the 5th guest in the third sample input is arriving at 2 and leaving at 9
according to me there are 3 more guest arriving at the same time period ie. guest2 guest 3 and guest4

making the total count to 4 how come it is 3 …
pls help me to clear what a simultaneous stay is !!!

i think, consider the number of guests per time frame, not according to their clock in and outs.

@zargus

Simultaneous means that the guest should be present there at that time.In the given test case guest 3 and 4 are never present together at the same time since 3 arrives at 5 and leaves at 6 while 4 arrives at 8. By this time 3 has already left.

alt text

plz refer to the explanation for test case 3 i provided in the image. I hope i play the helpful roll.

3 Likes