Add solution to ex10.1.9

It feels like this should be a recursive solution as per the other
exercises in this section, but I'm not sure how I'd do this as you're
not performing the same operation each time.
Add exercises 10.2.1 to 10.2.4