Problem 9 solve