sales = [10, 20, 30, 10, 40, 20]
k = 3
answer = 0
idx = 0
for i in range(len(sales)-k):
if sales[i] + sales[i+1] + sales[i+2] > answer:
answer = sales[i] + sales[i+1] + sales[i+2]
idx = i
print(answer)
To embed this project on your website, copy the following code and paste it into your website's HTML: