Pregunta de entrevista de Tata Consultancy Services

They asked coding part as sum of array