Add solution for problem 21.