Capacity To Ship Packages Within D Days
A conveyor belt has packages that must be shipped from one port to another within days days. The ith package has a weight of weights[i]. Each day, we load the ship with packages on the conveyor belt (in the order given by weights). We may not load more weight than the maximum weight capacity of the ship. Return the least weight capacity of the ship that will result in all the packages on the conveyor belt being shipped within days days.
Capacity To Ship Packages Within D Days

A conveyor belt has packages that must be shipped from one port to another within days days. The ith package has a weight of weights[i]. Each day, we load the ship with packages on the conveyor belt (in the order given by weights). We may not load more weight than the maximum weight capacity of the ship. Return the least weight capacity of the ship that will result in all the packages on the conveyor belt being shipped within days days.

Example 1:
Input: {"weights":[1,2,3,4,5,6,7,8,9,10],"days":5}
Output: 15
Input
arr ={"weights":[1,2,3,4,5,6,7,8,9,10],"days":5}

Start. Search range [max(weights), sum(weights)]

1

2

3

4

5

6

7

8

9

10

Low
10
Mid (k)

-

High
55

Result: 55

Variables
No variables to display
DepthFunction Call
Stack empty
0/11