ShipBob interview question

Implement your own version of reduce for an iterable