solved day1 part2 and day2

This commit is contained in:
0x01FE committed 2024-12-02 11:26:52 -06:00
1 parent ca9736d8ec
commit 0e732811ad
4 files changed
+1060 -3

No files matched your search

+6 -3
View File
@@ -34,9 +34,12 @@ print(f'Part 1: {total}')
lc = left.copy()
rc = right.copy()
while min(lc) != float('inf'):
total = 0
for i in range(0, len(lc)):
lowest_left = min(lc)
lowest_right = min(rc)
total += lowest_left * rc.count(lowest_left)
lc.pop(lc.index(lowest_left))
print(f'Part 2: {total}')