15 lines
443 B
Python
Executable File
15 lines
443 B
Python
Executable File
#!/usr/bin/env python3.11
|
|
from common import *
|
|
|
|
|
|
def part1(lpairs_of_stars: list[tuple[Coordinate, Coordinate]]) -> int:
|
|
logging.debug(f"pairs={lpairs_of_stars}")
|
|
distances = list(map(lambda gs: gs[0].distance(gs[1]), lpairs_of_stars))
|
|
logging.debug(f"distances={distances}")
|
|
return sum(distances)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
# logging.basicConfig(level=logging.DEBUG)
|
|
print(part1(pairs_of_stars(parse("input.txt"))))
|