Implement Array#reduce using recursion.