Simulate Chairs Required for Customer Events

Asked at Goldman Sachs · Coding Questions · Difficulty: Easy · Last asked Oct 26, 2024

A cafe tracks a stream of events, one character each, and wants to know how many chairs it must own so that every arriving customer gets a chair. Chairs are reused: a chair freed by a leaving customer can seat the next arrival.

Loading the problem…