Add solution for problem 17.