Algorithm · Upstart · Hard
A casino buffet can seat at most capacity diners simultaneously. You are given prices, where prices[i] is the amount customer i is willing to pay, along with events, a chronological array of customer IDs. All customer IDs are zero-based indices into prices. For any customer ID, its occurrences in events alternate between an arrival and a departure: the first occurrence is an arrival, the second is a departure, the third is an arrival again, the fourth a departure again, and…
Checking your access…