Added a solution to the Problem 8