solution for problem 74