Add solution to exercise 1-21.