17 lines
309 B
Python
17 lines
309 B
Python
from helper import load_lists
|
|
|
|
list_1, list_2 = load_lists()
|
|
|
|
id_counts = {}
|
|
for id in list_2:
|
|
if id not in id_counts:
|
|
id_counts[id] = 1
|
|
else:
|
|
id_counts[id] += 1
|
|
|
|
result = 0
|
|
for id in list_1:
|
|
if id in id_counts:
|
|
result += (id * id_counts[id])
|
|
|
|
print(result) |