Maintain a running sum of elements. Slide the window by adding the new element and removing the old one.
Compute sum of first elements.
For each position from to :
- Add
nums[i](entering the window). - Subtract
nums[i-k](leaving the window). - Update max sum if needed.
Return max sum divided by .