LOADING: An error occurred. Update Chrome, try Firefox, or visit this post for more details.

⚠️Reddit changed how removals work, which breaks Reveddit's website. Install the extension to track removed content:Add to chromeAdd to firefoxWhat changed?
✖︎
about reveddit
⚙F.A.Q.add-ons
r/
status
copy sharelink
[+] show filters
88
SOLUTION MEGATHREAD-🎄- 2022 Day 3 Solutions -🎄-(self.adventofcode)
submitted 3 years, 1 month ago* (edited 3 days, 4 hours after) by daggerdragon to /r/adventofcode (134.8k)
1614 commentsredditother-discussionssubreddit-indexmessage modsop-focus

NEWS

  • Solutions have been getting longer, so we're going to start enforcing [our rule on oversi...

... view full text

since 3 years, 1 month ago
3 of 3

Tip Reveddit Real-Time can notify you when your content is removed.

your account history
(check your username's removed content. why?)
Tip Check if your account has any removed comments.
view my removed comments
you are viewing a single comment's thread.
view all comments
[–][deleted]4 points3 years, 1 month ago

Python, trying to be readable....

data = open('input.txt','r').read().rstrip().split()

def priority(c):
    offset = 96 if c.islower() else 38
    return ord(c)-offset

part_1 = 0
for ruck in data:
    ru, ck = ruck[:len(ruck)//2], ruck[len(ruck)//2:]
    for item in (set(ru) & set(ck)):
        part_1 += priority(item)

part_2 = 0
for i in range(0,len(data),3):
    ruak, rubk, ruck = set(data[i]), set(data[i+1]), set(data[i+2])
    for item in (ruak & rubk & ruck):
        part_2 += priority(item)

print(part_1, part_2)
permalinkhide replies (1)as-of
[–][deleted]4 points3 years, 1 month ago

Very much appreciate the concept of naming split rucksack as ru and ck constitutes reasonable

permalinkparentcontexthide replies (1)as-of
[–][deleted]1 point3 years, 1 month ago

I was hoping someone would see that! Thanks 🙂

permalinkparentcontextas-of
r/revedditremoved.substack.com
🚨 NEWS 🚨
✖︎

Important: Reddit Changed How Removals Work

A recent Reddit update makes mod-removed content disappear from profile pages, which breaks Reveddit's website.

Install the browser extension to receive removal alerts.

Add to chromeAdd to firefox

What changed?

r/revedditremoved.substack.com