(transitions: set[str], pots: set[int])
| 1 | import aoc |
| 2 | |
| 3 | def step(transitions: set[str], pots: set[int]) -> set[int]: |
| 4 | new_pots = set() |
| 5 | for p in range(min(pots)-2,max(pots)+3): |
| 6 | s = ''.join('#' if p+j in pots else '.' for j in range(-2,3)) |
| 7 | if s in transitions: |
| 8 | new_pots.add(p) |
| 9 | return new_pots |
| 10 | |
| 11 | def part1(transitions: set[str], pots: set[int]) -> int: |
| 12 | for _ in range(20): |