Problems that use array/LinkedList are often asked to calculate or find something among all contiguous sublists of a given size k. For those problems, we can use the sliding window technique
https://www.figma.com/file/O2iMccgrLLNo8Nmm8G7Xow/Welcome-to-FigJam?type=whiteboard&node-id=0-1&t=elfzhopbBzI5g0nv-0
def solution(arr, k):
var1 = ... # variable to hold calculations
var2 = ... #variable to hold the result
start = 0 #start index
for end, value in enumerate(arr)
var1+=value
if/while some condition:
set var2 based on var1
var1 -=arr['start']
start+=1
return var2
Sliding Window Practice Problem
[WIP]