Problem 0002 solution.