Input
jobs = [10, 20, 30, 40, 50], k = 2
Output
90
Best split: [10, 20, 30] | [40, 50]. Bucket sums are 60 and 90; max is 90.
You're scheduling video-encoding jobs across a fixed pool of workers. Jobs must be assigned in order (a worker takes a *contiguous* run of jobs from the queue). Each worker processes its run sequentially, so a worker's...
main.pyEditable starterjobs = [10, 20, 30, 40, 50], k = 2
90
Best split: [10, 20, 30] | [40, 50]. Bucket sums are 60 and 90; max is 90.
jobs = [7, 2, 5, 10, 8], k = 2
18
Split [7, 2, 5] | [10, 8] → sums 14 and 18. Max is 18.
If jobs could be reordered freely, would the answer change? What problem does that turn into, and is it still tractable?