Pergunta de entrevista da empresa RBC

A python coding question with sliding window pattern