Minimum Sum of Weekly Peaks

Asked at Amazon · Coding Questions · Difficulty: Medium

Partition `costs` into exactly `weeks` contiguous groups (order preserved). Each group's *weekly input* is the maximum cost in that group. Minimize the total sum of the weekly inputs across all groups.

Loading the problem…