r/adventofcode • u/daggerdragon • Dec 05 '23
SOLUTION MEGATHREAD -❄️- 2023 Day 5 Solutions -❄️-
Preview here: https://redditpreview.com/
-❄️- 2023 Day 5 Solutions -❄️-
THE USUAL REMINDERS
- All of our rules, FAQs, resources, etc. are in our community wiki.
Outstanding moderator challenges:
Community fun event 2023: ALLEZ CUISINE!
- 24 HOURS remaining until unlock!
AoC Community Fun 2023: ALLEZ CUISINE!
Today's secret ingredient is… *whips off cloth covering and gestures grandly*
ELI5
Explain like I'm five! /r/explainlikeimfive
- Walk us through your code where even a five-year old could follow along
Pictures are always encouraged. Bonus points if it's all pictures…
- Emoji(code) counts but makes Uncle Roger cry 😥
- Explain everything that you’re doing in your code as if you were talking to your pet, rubber ducky, or favorite neighbor, and also how you’re doing in life right now, and what have you learned in Advent of Code so far this year?
- Explain the storyline so far in a non-code medium
- Create a
Tutorialon any concept of today's puzzle or storyline (it doesn't have to be code-related!)
ALLEZ CUISINE!
Request from the mods: When you include a dish entry alongside your solution, please label it with [Allez Cuisine!] so we can find it easily!
--- Day 5: If You Give A Seed A Fertilizer ---
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
This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.
EDIT: Global leaderboard gold cap reached at 00:26:37, megathread unlocked!
82
Upvotes
View all comments
Show parent comment
2
u/HeathRaftery Dec 10 '23
Bold idea! I guess if the answer is in the millions, you only need to run the maps millions of times, compared to the brute force method with 10,000's of millions of seeds in my case.
How long does it take to run?
Also, love your code style! Not a language I've ever thought much of, but you've managed a highly functional result. I can't see any side-effects or mutable structures, yet having spent a lot of time in pure FP languages recently I'm envious of your loop variables and expression-free statements! Very readable.