(transitions: set[str], pots: set[int])
| 14 | return sum(pots) |
| 15 | |
| 16 | def part2(transitions: set[str], pots: set[int]) -> int: |
| 17 | seen = set() |
| 18 | for n in range(1,1000): |
| 19 | pots = step(transitions, pots) |
| 20 | minpot = min(pots) |
| 21 | pattern = tuple(sorted(p - minpot for p in pots)) |
| 22 | if pattern in seen: |
| 23 | return (50000000000 - n) * len(pots) + sum(pots) |
| 24 | seen.add(pattern) |
| 25 | assert False |
| 26 | |
| 27 | @aoc.main('12') |
| 28 | def main(indata: str) -> tuple[int,int]: |