Live Batches
Masterclasses
Menu
Free Courses
Account
Login / Sign Up
Problem Submissions Solution

Capacity To Ship Packages Within D Days

Difficulty: Medium

Acceptance: 65.00%

Points: 30.00

You are given an array weights[] where weights[i] represents the weight of the ith package, and an integer days representing the number of days within which all packages must be shipped. Packages must be shipped in the given order, and each day you can ship packages whose total weight does not exceed the ship’s capacity. Return the minimum ship capacity required to ship all packages within the given number of days.

Topics

Companies

Articles

Examples:

N/A

Constraints:
  • 1 = weights.length = 5 × 104
  • 1 = weights[i] = 500
  • 1 = days = weights.length
Companies:
Amazon Microsoft Apple Visa
Topics:
Binary Search
Locked Content
Access Restricted: Please Login to access the code editor and test cases.