Adding problem 10 solution.