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.
asked …