Pregunta de entrevista de Cruise

Array algorithm involving aggregation/reduction