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

Function bounding_box

2018/src/06.py:6–9  ·  view source on GitHub ↗
(points: list[list[int]])

Source from the content-addressed store, hash-verified

4from typing import Iterable
5
6def bounding_box(points: list[list[int]]) -> Iterable[tuple[int,int]]:
7 xmin, xmax = min(x for x,_ in points), max(x for x,_ in points)
8 ymin, ymax = min(y for _,y in points), max(y for _,y in points)
9 yield from product(range(xmin,xmax+1), range(ymin,ymax+1))
10
11def part1(points: list[list[int]]) -> int:
12 closest = {}

Callers 2

part1Function · 0.85
part2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected