Problem 49 solution and problem 50 start