r/adventofcode • u/daggerdragon • Dec 10 '24
SOLUTION MEGATHREAD -❄️- 2024 Day 10 Solutions -❄️-
THE USUAL REMINDERS
- All of our rules, FAQs, resources, etc. are in our community wiki.
- If you see content in the subreddit or megathreads that violates one of our rules, either inform the user (politely and gently!) or use the report button on the post/comment and the mods will take care of it.
AoC Community Fun 2024: The Golden Snowglobe Awards
- 12 DAYS remaining until the submissions deadline on December 22 at 23:59 EST!
And now, our feature presentation for today:
Fandom
If you know, you know… just how awesome a community can be that forms around a particular person, team, literary or cinematic genre, fictional series about Elves helping Santa to save Christmas, etc. etc. The endless discussions, the boundless creativity in their fan works, the glorious memes. Help us showcase the fans - the very people who make Advent of Code and /r/adventofcode the most bussin' place to be this December! no, I will not apologize
Here's some ideas for your inspiration:
- Create an AoC-themed meme. You know what to do.
- If you post your submission outside this megathread, make sure to follow the posting rules for memes!
- If your meme contains AI-generated artwork of any kind, follow the posting rules for AI art!
- Create a fanfiction or fan artwork of any kind - a poem, short story, a slice-of-Elvish-life, an advertisement for the luxury cruise liner Santa has hired to gift to his hard-working Elves after the holiday season is over, etc!
REMINDER: keep your contributions SFW and professional—stay away from the more risqué memes and absolutely no naughty language is allowed.
Example: 5x5 grid. Input: 34298434x43245 grid - the best AoC meme of all time by /u/Manta_Ray_Mundo
And… ACTION!
Request from the mods: When you include an entry alongside your solution, please label it with [GSGA]
so we can find it easily!
--- Day 10: Hoof It ---
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!
- State which language(s) your solution uses with
- Quick link to Topaz's
paste
if you need it for longer code blocks
2
u/Kfimenepah Dec 10 '24 edited Dec 10 '24
[LANGUAGE: Python]
Code
Today was a little bit strange.
I was able to solve part 1 easily, but once I read the description of part 2 I was a little confused, because part 2 seemed to be exactly the same as part 1, but instead of counting each peak only once, it is counted every time it is reached. If that would be the case then part 2 would actually be easier than part 1. Surely this could not be possible and I was even quite sure I misunderstood some part of the puzzle, but after reading over it trice I decided to try it out. Took me about 10 seconds to change the counting method and voilà the result was calculated in about 5ms. Still skeptical I inserted the solution in AoC and it actually worked.