Problem 3430 · Hard

Maximum and Minimum Sums of at Most Size K Subarrays

Extend each subarray start up to k elements while tracking its running minimum and maximum, and add both to the total.

Open the interactive visualisation