1
0
2024_Advent_of_Code/day1/part2.py
2024-12-03 11:27:49 -05:00

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)