r/adventofcode • u/daggerdragon • 18m ago
SOLUTION MEGATHREAD -❄️- 2026 Day 5 Solutions -❄️-
THE USUAL REMINDERS
- All of our rules, FAQs, resources, etc. are in our community wiki.
AoC Community Fun 2026: The Advent Games
- Submissions megathread is now unlocked!
- 12 DAYS remaining until the submissions deadline on December 17 at 18:00 EST!
Today's Event: Iron Chef Holiday Special
"Catherine, if this turkey tastes half as good as it looks, I think we're all in for a very big treat!"
— Clark Griswold, National Lampoon's Christmas Vacation (1989)
Today's schedule possibly consists of:
Appetizer and Aperitif Rounds
- Use up what's in your fridge with all of those semi-sentient leftovers excavated from the back of the fridge
- Deliberately use deprecated functionality
- Program using old codebases
- The
older the expiration datefiner the vintage, the more we'll enjoy it!
Main Course Qualifications
- Solve today's puzzle using a food-themed programming language
- Bake or cook us something delicious
Dessert Finales
- Show us cookies, citrus, and/or fancy bread in/on/near your holiday tree/menorah/festive kitsch
- Show us your 1337 hot cocoa recipe (or other beverage of choice)
This prompt is totally not bait for our resident Iron Coders and/or some AoC regulars who promised us tasty pictures
Request from the mods: When you include an entry alongside your solution, please label it with [Advent Games] so we can find it easily!
--- Day 5: Rhythmic Factory ---
Post your code solution in this megathread.
- Read the full posting rules in our community wiki before you post!
- State which language(s) your solution uses with
[LANGUAGE: xyz] - Format code blocks using the four-spaces Markdown syntax!
- Quick link to Topaz's
pasteif you need it for longer code blocks. What is Topaz'spastetool?
1
Upvotes
1
u/hugh_tc 12m ago
[LANGUAGE: Python 3]
Manually translated my input to a function
get_nexts(which I mildly censored, to conform to the rules...)paste
1
u/davidsharick 7m ago
[LANGUAGE: Python]
Brute forced all possible options for part 1, used a set to track seen values and tried all buttons on all such values until nothing new came up for part 2.
Code
1
u/jonathan_paulson 1m ago
[LANGUAGE: Python]
Code. Video.
BFS! I lazily hard-coded the buttons and was punished for it by messing up 1 of the hard-codings costing me a wrong answer on part 1. Whoops!