Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use a queue to store the people who want to enter or exit and their corresponding times.
Simulate the process described in the statement and apply the 4 rules to the people crossing the door.