Use binary search over the possible maximum subarray sum to find the smallest value that allows splitting into at most k subarrays.
Constraints
Example
```python >>> split_array([7, 2, 5, 10, 8], 2) 18 >>> split_array([1, 2, 3, 4, 5], 1) 15 >>> split_array([1, 2, 3, 4, 5], 5) 5 >>> split_array([5, 5, 5, 5], 2) 10 ```
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints