Pergunta de entrevista da empresa Citi

Propose an efficient code that count moving average.