Solve recursion exercises