2024(1): Solve Historian Hysteria

This commit is contained in:
2024-12-18 09:29:04 +01:00
parent c1d915a55b
commit 6d6b4bb8cb
4 changed files with 1064 additions and 0 deletions

15
2024/1/1.py Normal file
View File

@ -0,0 +1,15 @@
import numpy as np
# Load both columns into numpy arrays of type int
left, right = np.loadtxt('input', dtype=int).T
# Sort both lists (ASC)
left.sort()
right.sort()
# Just calculate the distances.
distances = np.abs(left - right)
distance = np.sum(distances)
print(f"The total distance is {distance}.")