MCPcopy Create free account
hub / github.com/AxlLind/AdventOfCode / step

Function step

2018/src/12.py:3–9  ·  view source on GitHub ↗
(transitions: set[str], pots: set[int])

Source from the content-addressed store, hash-verified

1import aoc
2
3def 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
11def part1(transitions: set[str], pots: set[int]) -> int:
12 for _ in range(20):

Callers 2

part1Function · 0.70
part2Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected