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
20
SOLUTION MEGATHREAD-❄️- 2024 Day 22 Solutions -❄️-(self.adventofcode)
submitted 1 year, 1 month ago* (edited 12 minutes after) by daggerdragon to /r/adventofcode (134.8k)
451 commentsredditother-discussionssubreddit-indexmessage modsop-focus

THE USUAL REMINDERS

  • All of our rules, FAQs, resources, etc. are in our [community wiki](https:...

... view full text

since 1 year, 1 month ago
1 of 1

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]2 points1 year, 1 month ago

[LANGUAGE: Go]

Today was a very welcome change of pace.

Part One: There isn't much room for any optimizations, its as easy as it can be. Just perform the given operations on each number and that's that. Since all of the "operators" are in powers of two, the corresponding operations can be converted to bit manipulation.

Part Two: I was expecting something much worse but it was quite simple(contrary to whatever yesterday was). My solution is a brute force in the sense that it maintains a cache for each 4-diff conbination to the bananas collected by all sellers. Then I can simply find the max banana yield and return it. Takes about maybe half a second to run.

One thing I messed up in part two was that I counted the same sequence for the same seller as many times as it occurred (instead of counting only once), took me a while to debug that.

Apart from that minor hiccup, this was an easy problem and I am all for it(given that I am still debugging day 21 part 2 :). Here is the solution.

permalinkas-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