Pregunta de entrevista de Amazon

Find average based on rolling window