2024(2): There is puzzle 2.

This commit is contained in:
2024-12-18 09:35:30 +01:00
parent 6d6b4bb8cb
commit c2c5a7f231
3 changed files with 57 additions and 1 deletions

12
2024/1/2.py Normal file
View File

@ -0,0 +1,12 @@
import numpy as np
# Load both columns into numpy arrays of type int
left, right = np.loadtxt("input", dtype=int).T
similarity_score = 0
for l in left:
similarity_score += l*np.sum(right == l)
print(f"The similarity score is {similarity_score}.")