Problem 3026 · Medium

Maximum Good Subarray Sum

For each end, look up the lowest prefix sum among earlier starts whose value differs by k, using a map keyed by value.

Open the interactive visualisation