Pregunta de entrevista de RBC

A python coding question with sliding window pattern