Facebook Pixel

Split Array Largest Sum

Given an array of non-negative integers and an integer m, such that you are able to split the array into m non-empty continuous subarrays. Write an algorithm to minimize the largest sum among these m subarrays.

Examples

Example 1:

Input: [7,2,5,10,8], m = 2

Output: 18

Try it yourself

Invest in Yourself
Your new job is waiting. 83% of people that complete the program get a job offer. Unlock unlimited access to all content and features.
Go Pro