Added the solution to the problem 9