Minimum ship capacity
Packages with given integer weights must be shipped in their given order within at most 'days' days. Each day you load consecutive packages onto a ship without exceeding its capacity. Return the minimum ship capacity that lets you ship everything within 'days' days. Assume 1 <= days <= len(weights).
Implement
min_ship_capacity(weights: list[int], days: int) → intExamples
in
[[1,2,3,4,5,6,7,8,9,10],5]out15What a strong answer looks like
State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
0:00 of about 30 min
solution.py
InputExpectedGot
[[1,2,3,4,5,6,7,8,9,10],5]15not run yetsample