Add solution for problem 23.