Pergunta de entrevista da empresa Tata Consultancy Services

They asked coding part as sum of array