Unable to load image
Reported by:

rDrama Advent of Code Day 1: Warm up

I hope this fine morning finds you well, saars.

The word of the day is collections.Counter

The rdrama leaderboard invite code is 632268-30587026

I created the ping group: !AOC, I'm sure it will be useful offseason too.

Charts! https://github.com/jeroenheijmans/advent-of-code-charts

19
Jump in the discussion.

No email address required.

left_list = []
right_list = []

for line in input_text.split("\n"):
    left_list.append(int(line.split()[0]))
    right_list.append(int(line.split()[1]))
    
left_list.sort()
right_list.sort()

ans = 0
for l, r in zip(left_list, right_list, strict=True):
    ans += l * right_list.count(l)
    
print(ans)
Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.