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

Function part1

2018/src/23.py:5–7  ·  view source on GitHub ↗
(bots: list[list[int]])

Source from the content-addressed store, hash-verified

3from z3 import If, Int, Optimize
4
5def part1(bots: list[list[int]]) -> int:
6 x,y,z,r = max(bots, key=lambda b: b[3])
7 return sum(abs(x1-x) + abs(y1-y) + abs(z1-z) <= r for x1,y1,z1,_ in bots)
8
9def part2(bots: list[list[int]]) -> int:
10 def abs(x):

Callers 1

mainFunction · 0.70

Calls 1

absFunction · 0.85

Tested by

no test coverage detected