Hackerrank
Hackerrank Ruby - Enumerable - reduce Solution
A common scenario that arises when using a collection of any sort, is to get perform a single type of operation with all the elements and collect the result. For example, a sum(array) function might wish to add all the elements passed as the array and return the result.