Python solution to Flower Garden problem.