Search
⌘K

Leetcode 1204. Last Person to Fit in the Bus

Order the people by their turn and compute a running total of weights, then return the person_name of the last person whose addition keeps the cumulative weight ≤ 1000 (stop before exceeding the limit).


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.