Skip to content
Veltoryx Technologies
ProProblem 42● HardLeetCode #410 ↗5 min readUpdated 30 October 2026

Split Array Largest Sum

Minimize the maximum subarray sum when splitting an array into k contiguous pieces using binary search on the answer with greedy validation.

01The problem

Given an integer array nums and an integer k, split nums into k non-empty contiguous subarrays such that the largest sum of any subarray is minimized.

Return the minimized largest sum of the split.

Think of k workers sharing ordered tasks sequentially: how do you distribute the workload so that the most burdened worker has to do as little work as possible?

InputOutputWhy
nums = [7, 2, 5, 10, 8], k = 218Best split is [7, 2, 5] (sum 14) and [10, 8] (sum 18)
nums = [1, 2, 3, 4, 5], k = 29Best split is [1, 2, 3] (sum 6) and [4, 5] (sum 9)
nums = [1, 4, 4], k = 34Best split has one element per subarray, max sum is 4

Constraints: 1 to 1,000 numbers, values from 0 to 1,000,000, k between 1 and min(50, n).

Loading the rest of the lesson…