Approach hintTry it first, then revealHide
Add the passenger count at each pickup point and subtract it at each drop-off point in a difference array, then sweep left to right and check the running load never exceeds capacity.
Add the passenger count at each pickup point and subtract it at each drop-off point in a difference array, then sweep left to right and check the running load never exceeds capacity.