Problem 011 solution.