Capacity to Ship Packages Within D Days

Medium · Binary Search · about 20 minutes

Asked at Amazon, Google, DoorDash.

Packages with weights weights[i] must be shipped in the given order within days days. Each day you load packages onto a ship, in order, without exceeding the ship's capacity. Return the least capacity that lets you ship everything within days days.

Related guides