13 lines
253 B
Python
13 lines
253 B
Python
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}.")
|