Off By One Window

This is meant to return the largest sum of any k consecutive elements. It contains a single index bug.

def max_window_sum(a, k):
    total = sum(a[:k])
    best = total
    for i in range(k, len(a)):
        total += a[i] - a[i - k + 1]
        best = max(best, total)
    return best

What does max_window_sum([1, 3, 2, 6, 2, 8], 3) actually return?

A

14

B

11

C

16

D

9