Pergunta de entrevista da empresa Amazon

Find average based on rolling window