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.
Board passengers greedily in arrival order, then find the latest free moment on the last bus that is not taken by a passenger.