Distributed Batch Scheduling to Minimize Peak Load

You manage a distributed processing pipeline that must handle n jobs in order. Each job i has workload nums[i] and the pipeline must be divided into exactly k contiguous batches, each batch assigned to a separate worker. The load of a worker is the sum of workloads in its batch. Your goal is to choose the split points so that the largest load among all workers is as small as possible. Return that minimized peak load.

All batches must be non-empty and must respect the original order, so every valid allocation corresponds to cutting the array nums into k contiguous subarrays. The answer is the minimum achievable value of the maximum subarray sum.

Examples
Input: [[7,2,5,10,8],2]
Output: 18
Hints

Distributed Batch Scheduling to Minimize Peak Load

You manage a distributed processing pipeline that must handle `n` jobs in order. Each job `i` has workload `nums[i]` and the pipeline must be divided into exactly `k` contiguous batches, each batch assigned to a separate worker. The load of a worker is the sum of workloads in its batch. Your goal is to choose the split points so that the largest load among all workers is as small as possible. Return that minimized peak load.