Solution 38 reduce and recur