2617. Time Taken to Cross the Door

Hard
Array
Queue
Simulation

Description

Hints

Hint 1
Use a queue to store the people who want to enter or exit and their corresponding times.
Hint 2
Simulate the process described in the statement and apply the 4 rules to the people crossing the door.

Statistics

Acceptance
49.9%
Submissions
27,332
Accepted
13,649