Amazon | Onsite | Split Array Largest Sum
Anonymous User
3186

https://leetcode.com/problems/split-array-largest-sum/

Input:

n = 3
x = [7,3,5,9,1,2]

You need to split the array x into n consecutive subarrays. For example, you can split x into
[7,3], [5,9], [1,2] or [7,3,5], [9], [1,2]. But you cannot split x into [7,5,9], [3], [1,2] because [7,5,9]is not consecutive.

You should output the minimum maximum sum of every subarrays.

In this case, the output is 12:
[7,3], [5], [9,1,2] or [7], [3,5], [9,1,2]

Comments (6)