Moving Average — a circular buffer
A fixed-size buffer holds the last k values. Each new value overwrites the oldest slot, and the running sum is patched in O(1) — no re-adding the whole window.
Try:
circular buffer
window sum 0
moving average