1
0
This commit is contained in:
Nicolas Green 2024-12-03 07:47:48 -05:00
parent b994a738f6
commit 1db5c69980
No known key found for this signature in database
3 changed files with 1022 additions and 0 deletions

1000
day1/input.txt Normal file

File diff suppressed because it is too large Load Diff

16
day1/main.py Normal file
View File

@ -0,0 +1,16 @@
first_list = []
second_list = []
result = 0
with open("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)
first_list.sort()
second_list.sort()
for i in range(len(first_list)):
result += abs(first_list[i] - second_list[i])
print(result)

6
day1/test_input.txt Normal file
View File

@ -0,0 +1,6 @@
3 4
4 3
2 5
1 3
3 9
3 3