Search
⌘K

Leetcode 2332. The Latest Time to Catch a Bus

Given unsorted bus departure times and passenger arrival times with a per-bus capacity, sort and simulate buses in chronological order filling them with the earliest waiting passengers; return the latest time (distinct from any passenger) you can arrive to still board — either the last bus's departure if it has room, or just before the last passenger who boarded a full last bus.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.