ThousandEyes Interview Question

reduce a tree (using array.prototype.reduce)