Add solution to Problem 9