Problem 53 solution
Problem 56 solution