You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
给定一个非负整数数组和一个整数 m,你需要将这个数组分成 m 个非空的连续子数组。设计一个算法使得这 m 个子数组各自和的最大值最小。
Example
Input:
nums = [7,2,5,10,8]
m = 2
Output:
18
Explanation:
There are four ways to split nums into two subarrays.
The best way is to split it into [7,2,5] and [10,8],
where the largest sum among the two subarrays is only 18.
Note
1 ≤ n ≤ 1000
1 ≤ m ≤ min(50, n)
The text was updated successfully, but these errors were encountered:
410. Split Array Largest Sum
给定一个非负整数数组和一个整数
m
,你需要将这个数组分成m
个非空的连续子数组。设计一个算法使得这m
个子数组各自和的最大值最小。Example
Note
1 ≤ n ≤ 1000
1 ≤ m ≤ min(50, n)
The text was updated successfully, but these errors were encountered: