r/adventofcode • • Dec 24 '22

SOLUTION MEGATHREAD -πŸŽ„- 2022 Day 24 Solutions -πŸŽ„-

All of our rules, FAQs, resources, etc. are in our community wiki.


UPDATES

[Update @ 00:21:08]: SILVER CAP, GOLD 47

  • Lord of the Rings has elves in it, therefore the LotR trilogy counts as Christmas movies. change_my_mind.meme


AoC Community Fun 2022:

πŸŒΏπŸ’ MisTILtoe Elf-ucation πŸ§‘β€πŸ«


--- Day 24: Blizzard Basin ---


Post your code solution in this megathread.


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:48, megathread unlocked!

23 Upvotes

390 comments sorted by

View all comments

10

u/SLiV9 Dec 24 '22

Rust

Both parts in ~1ms without any heap allocations. For this one I took roughly the same approach as yesterday's challenge: each row is a u128, and luckily there were only 122 columns this time. And I used Shroedinger's Quantum Elves(tm): elves exist in multiple places at the same time and each step I move elves to all four directions, and then kill the ones that end up in a storm or inside a wall. I thought the solution would require the fact that the storms at time t are in the same positions as time t + N, but I didn't end up using that.

All in all this felt like a breeze compared to the last few. (Or perhaps a nice little early Christmas gift from Eric!)

→ More replies (3)