I am unable to understand the problem statement. Can someone please explain me the testcase.
Max Sum K partition
1 Like
Divide the array into subarrays each of size k (last subarray may be of size less than k) .
Pick the largest element from each subarray ( you may take 0 if all negative)
Sum them up.
Note: you canβt take i and j if |i-j| = k
Eg
6 5
5 4 3 2 1 -1
take 5 and none from two subarrays.