Implemented "Degrees of Bacon" solution.