Optimize 2017/day21.py
After 3 iterations, a 3x3 grid is transformed into a 9x9 grid, whose
component 3x3 grids can be treated separately from that point on.
Instead of building the full grid (which grows exponentially), store a
count of each 3x3 "subgrid" and operate on each of them independently.