Expand description
§Subterranean Sustainability
The problem is a one dimensional version of Conway’s Game of Life.
We use a vector to store which pots are occupied and which are empty in each generation. When calculating the next step, we truncate the bit vector on the left and right. This makes it easier to compare generations in part two.
The trick for part two is that the plants will eventually stabilize into a stable pattern (similar to a glider) that moves by the same amount each generation. Once two subsequent generations are the same, except for the starting position, we extrapolate 50 billion generations into the future.
Structs§
- Pots 🔒
Functions§
Type Aliases§
- Input 🔒