Day1 completed

This commit is contained in:
2024-12-01 14:15:11 +01:00
commit 47cab6a2c7
5 changed files with 48 additions and 0 deletions

12
day1/part1.py Normal file
View File

@@ -0,0 +1,12 @@
from common import parse, split_and_sort
def main() -> None:
l1, l2 = split_and_sort(parse('input'))
assert ( len(l1) == len(l2))
print(sum(map(lambda i: abs(l1[i] - l2[i]), range(len(l1)))))
if __name__ == '__main__':
main()