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

Function main

2018/src/20.py:69–74  ·  view source on GitHub ↗
(indata: str)

Source from the content-addressed store, hash-verified

67
68@aoc.main('20')
69def main(indata: str) -> tuple[int,int]:
70 _, regex = parse_regex(indata[1:-1], 0)
71 m = defaultdict(set)
72 apply_regex(m,regex,[(0,0)])
73 distances = bfs_distances(m)
74 return max(distances), sum(d >= 1000 for d in distances)
75
76if __name__ == "__main__":
77 main()

Callers 1

20.pyFile · 0.70

Calls 3

parse_regexFunction · 0.85
apply_regexFunction · 0.85
bfs_distancesFunction · 0.85

Tested by

no test coverage detected