23
SOLUTION MEGATHREAD-🎄- 2022 Day 21 Solutions -🎄-(self.adventofcode)
submitted 3 years, 1 month ago* (edited 16 minutes after) by daggerdragon to /r/adventofcode (134.8k)
THE USUAL REMINDERS
- All of our rules, FAQs, resources, etc. are in our [community wiki](/r/adv...
3 years ago
—
3 years, 1 month ago2 of 2
Tip Reveddit Real-Time can notify you when your content is removed.
your account history
Tip Check if your account has any removed comments.
view my removed comments you are viewing a single comment's thread.
view all comments


Ruby, part 2. The code is horrible, but I am kind of proud of myself, seeing how others used binary search, o some online equation solvers.
The idea is starting from root build two chains of operations - one which ends in 'humn' and the other, where it ends in value node. Then at the root we know the final value of one chain, and need to go through the human chain reversing each operation so we end up with the initial value 'humn' should return.
Your code block is too long for the megathreads. Please read our article on oversized code, then edit your post to replace the code block with an external link to your code.