Pergunta de entrevista da empresa Careem

Sum of all elements in array without taking index into account