Pregunta de entrevista de Citi

Propose an efficient code that count moving average.