0410. Split Array Largest Sum
Hard | Binary Search | 32 ms (92.40%), 14.3 MB (65.39%)
Source: LeetCode - Aplit Array Largest Sum GitHub: Solution / Performance
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.
Same as LeetCode 1011
Binary Search Problem Find a minimum largest sum among these m subarrays.
Boundary / Search Space
Left (Minimum) = MAX number (cannot seperate a single number) Right (Maximum) = TOTAL amount
Condition
While Loop = Left < Right
Return Value
Left
Last updated
Was this helpful?