Your puzzle input also contains some notes you find on a nearby table: someone has been trying to figure out how these plants spread to nearby pots. Based on the notes, for each generation of plants, a given pot has or does not have a plant based on whether that pot (and the two pots on either side of it) had a plant in the last generation. These are written as LLCRR => N
, where L
are pots to the left, C
is the current pot being considered, R
are the pots to the right, and N
is whether the current pot will have a plant in the next generation. For example:
..#.. => .
means that a pot that contains a plant but with no plants within two pots of it will not have a plant in it during the next generation.##.## => .
means that an empty pot with two plants on each side of it will remain empty in the next generation..##.# => #
means that a pot has a plant in a given generation if, in the previous generation, there were plants in that pot, the one immediately to the left, and the one two pots to the right, but not in the ones immediately to the right and two to the left.After 20
generations, what is the sum of the numbers of all pots which contain a plant?