Split the array into k contiguous subarrays so as to minimize the largest subarray sum.
Example 1
Input: nums = [7,2,5,10,8], k = 2
Output: 18
Explanation: The optimal partition gives a maximum sum of 18.
Output: 18
Explanation: The optimal partition gives a maximum sum of 18.
Example 2
Input: nums = [1,2,3,4,5], k = 2
Output: 9
Explanation: The optimal partition gives a maximum sum of 9.
Output: 9
Explanation: The optimal partition gives a maximum sum of 9.