410. Split Array Largest Sum
Practice Split Array Largest Sum for free on NudgeCode: Hard, Binary Search pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.
Split the array nums into exactly k non-empty contiguous pieces. Among all ways to do this, return the smallest possible value of the largest piece sum.
Example
nums = [7,2,5,10,8], k = 2 -> 18 ([7,2,5] and [10,8])
Constraints
- 1 <= nums.length <= 1000
- 0 <= nums[i] <= 10^6
- 1 <= k <= min(50, nums.length)