Approach hintTry it first, then revealHide
Slide a window of exactly k elements, adding the element that enters and subtracting the one that leaves; track the largest window sum and divide by k only once at the end.
Slide a window of exactly k elements, adding the element that enters and subtracting the one that leaves; track the largest window sum and divide by k only once at the end.