Hard
Split Array Largest Sum
Hard
8 submissions
50 coins
+200 XP
Binary Search
Dynamic Programming
Greedy
Problem Description
Split `nums` into exactly `k` non-empty contiguous parts so that the largest part-sum is as small as possible. Return that smallest possible largest sum.
**Example 1:**
```
Input: nums = [7, 2, 5, 10, 8], k = 2
Output: 18
```
**Example 2:**
```
Input: nums = [1, 2, 3, 4, 5], k = 2
Output: 9
```
**Example 3:**
```
Input: nums = [1, 4, 4], k = 3
Output: 4
```
Constraints
- `1 <= nums.length <= 1000`
- `0 <= nums[i] <= 10^6`
- `1 <= k <= min(50, nums.length)`
Need help?
Connect with expert programmers for real-time collaborative coding, video meetings, and whiteboard sessions via CodeConnect.
Video Call
Whiteboard
Live Coding
Screen Share