Solved medium problem 46.