Problem 0011 solution.