13 lines
342 B
Python
13 lines
342 B
Python
first_list = []
|
|
second_list = []
|
|
result = 0
|
|
with open("part2_input.txt", "r") as file_input:
|
|
for row in file_input:
|
|
first_column, second_column = map(int, row.split(" "))
|
|
first_list.append(first_column)
|
|
second_list.append(second_column)
|
|
|
|
for i in first_list:
|
|
result += i * second_list.count(i)
|
|
|
|
print(result) |