Pregunta de entrevista de Amazon

Sliding window and a non-algorithm python question