arraysdsa
Sliding windows get tricky with negative values
Anonymous
The usual sum-based window trick relies on extending the right edge not decreasing the sum and moving the left edge not increasing it. Nonnegative values give that behavior; negative values can break it. For arbitrary signed values, prefix sums and a suitable data structure may be needed.
0