Add problem 9 solution