Tap here to switch tabs
Problem
Submissions

Problem: Capacity To Ship Packages Within D Days

med
30 min
Try to solve the Capacity To Ship Packages Within D Days problem.

Statement

A conveyor belt carries packages that need to be shipped within days days.

The weight of package ii is weights[i]. Packages must be loaded onto the ship in the exact order given by weights. The combined weight loaded on any single day cannot exceed the maximum capacity of the ship.

Determine the minimum capacity of the ship required to ship all packages within days days.

Constraints:

  • 1≤1 \le days ≤\le weights.length ≤5×104\le 5 \times 10^4

  • 1≤1 \le weights[i] ≤500\le 500

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Capacity To Ship Packages Within D Days

med
30 min
Try to solve the Capacity To Ship Packages Within D Days problem.

Statement

A conveyor belt carries packages that need to be shipped within days days.

The weight of package ii is weights[i]. Packages must be loaded onto the ship in the exact order given by weights. The combined weight loaded on any single day cannot exceed the maximum capacity of the ship.

Determine the minimum capacity of the ship required to ship all packages within days days.

Constraints:

  • 1≤1 \le days ≤\le weights.length ≤5×104\le 5 \times 10^4

  • 1≤1 \le weights[i] ≤500\le 500