Fixed-Length Window
Given an array of sales, find the most sales in any k-day period.
i
3
0
2
1
7
2
5
3
1
4
4
5
cur=0
k=3
res=0
Step 1 / 11
Step 1:
Initialize: calculate sum of first k=3 days. sales=[3, 2, 7, 5, 1, 4]
Pointers: i=0
Focus: default
cur=0k=3res=0