Problem 2332 · Medium

The Latest Time to Catch a Bus

Board passengers greedily in arrival order, then find the latest free moment on the last bus that is not taken by a passenger.

Open the interactive visualisation