410. Split Array Largest Sum
LeetCode 410. Split Array Largest Sum
Description
Given an array nums
which consists of non-negative integers and an integer m
, you can split the array into m
non-empty continuous subarrays.
Write an algorithm to minimize the largest sum among these m
subarrays.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= nums.length <= 1000
0 <= nums[i] <= 10^6
1 <= m <= min(50, nums.length)
Tags
Binary Search, Dynamic Programming
Solution
Totally same as LeetCode 1011. See Reference.
Complexity
Time complexity:
Space complexity:
Code
Reference
Last updated
Was this helpful?