[LeetCode] The Number of the Smallest Unoccupied Chair

1 · · Jan. 15, 2022, 5:26 a.m.
1942. The Number of the Smallest Unoccupied Chair There is a party where n friends numbered from 0 to n - 1 are attending. There is an infinite number of chairs in this party that are numbered from 0 to infinity. When a friend arrives at the party, they sit on the unoccupied chair with the smallest number. For example, if chairs 0, 1, and 5 are occupied when a friend comes, they will sit on chair number 2. When a friend leaves the party, their chair becomes unoccupied at the moment they leave...