Maximum sum window of size k
Slide a window of k values along the array, updating its sum in O(1) per step.
Values2, 1, 5, 1, 3, 2, 6, 1k 3
Sum the first window of 3: 2, 1, 5 = 8.
- compare
- swap or write
- settled
Space play · ← → step · Home End jump · drag the strip to scrub