2dbi

Capacity To Ship Packages Within D Days

viaLeetCode

A conveyor belt has packages that must be shipped from one port to another within B days. The i-th package has weight A[i]. Each day you load the ship, in order, without exceeding its weight capacity. Return the least ship capacity so that all packages ship within B days. Solve with binary search on the capacity. Example: A=[1..10], B=5 → 15.

Add a follow-up question they asked
No follow-ups yet. Be the first to add one.
asked …
LeaderboardSalary
Language
Account