Cruise interview question

Array algorithm involving aggregation/reduction