solving part 2
This commit is contained in:
parent
162fc8cf2f
commit
4a405ba095
13
day1/part2.py
Normal file
13
day1/part2.py
Normal file
@ -0,0 +1,13 @@
|
||||
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)
|
||||
1000
day1/part2_input.txt
Normal file
1000
day1/part2_input.txt
Normal file
File diff suppressed because it is too large
Load Diff
6
day1/test_part2_input.txt
Normal file
6
day1/test_part2_input.txt
Normal file
@ -0,0 +1,6 @@
|
||||
3 4
|
||||
4 3
|
||||
2 5
|
||||
1 3
|
||||
3 9
|
||||
3 3
|
||||
Loading…
Reference in New Issue
Block a user