(points: list[list[int]])
| 4 | from typing import Iterable |
| 5 | |
| 6 | def 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 | |
| 11 | def part1(points: list[list[int]]) -> int: |
| 12 | closest = {} |