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

Function pop_constellation

2018/src/25.py:7–12  ·  view source on GitHub ↗
(stars: list[list[int]], s: list[int])

Source from the content-addressed store, hash-verified

5 return sum(abs(a-b) for a,b in zip(s1,s2))
6
7def pop_constellation(stars: list[list[int]], s: list[int]):
8 if s not in stars:
9 return
10 stars.remove(s)
11 for s2 in [s2 for s2 in stars if dist(s,s2) < 4]:
12 pop_constellation(stars, s2)
13
14@aoc.main('25')
15def main(indata: str) -> tuple[int,str]:

Callers 1

mainFunction · 0.85

Calls 1

distFunction · 0.85

Tested by

no test coverage detected