Pergunta de entrevista da empresa Bolt

Average array program. it was easy to solve.