Given an integer array arr, partition the array into contiguous subarrays of length at most k. After partitioning, each subarray has their values changed to become the maximum value of that subarray. Return the largest sum of the given array after partitioning.
Click Run to execute sample tests.