Search
⌘K

Leetcode 1094. Car Pooling

Given trips as [numPassengers, from, to] on a one-way (eastbound) route, determine if the vehicle's passenger count ever exceeds capacity while picking up and dropping off riders. This is a sweep-line/difference-array problem: treat pickups and dropoffs as events, accumulate the current load along the route, and verify it never surpasses capacity.

Asked at:

Meta


Question Timeline

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

Early November, 2025

Meta

Mid-level

Early June, 2025

Meta

Mid-level

Mid April, 2025

Meta

Mid-level

Comments

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