Problem 3381 · Medium

Maximum Subarray Sum With Length Divisible by K

Subarrays whose length is divisible by k start at prefix indices with the same residue, so keep the lowest prefix per residue.

Open the interactive visualisation