r/adventofcode • • Dec 22 '19

SOLUTION MEGATHREAD -🎄- 2019 Day 22 Solutions -🎄-

--- Day 22: Slam Shuffle ---


Post your full code solution using /u/topaz2078's paste or other external repo.

  • Please do NOT post your full code (unless it is very short)
  • If you do, use old.reddit's four-spaces formatting, NOT new.reddit's triple backticks formatting.
  • Include the language(s) you're using.

(Full posting rules are HERE if you need a refresher).


Reminder: Top-level posts in Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


Advent of Code's Poems for Programmers

Click here for full rules

Note: If you submit a poem, please add [POEM] somewhere nearby to make it easier for us moderators to ensure that we include your poem for voting consideration.

Day 21's winner #1: nobody! :(

Nobody submitted any poems at all for Day 21 :( Not one person. :'(


This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.

EDIT: Leaderboard capped, thread unlocked at 02:03:46!

30 Upvotes

167 comments sorted by

View all comments

Show parent comment

4

u/Kullu00 Dec 22 '19

First, thank you for the writeup. I gave up on this part after 2 hours, and started reading solutions in here. Those solutions still made no sense to me. I didn't understand how to solve this, and that's with people telling me what method to use. Going step-by-step like this was the only way I would ever have finished this.

I don't consider myself a beginner programmer. I've finished AoC since it began in 2015, sometimes with a bit of help, but today is the first day that, even with infinite time, I would not have gotten closer to solving it. It's not even that this problem is more math-focused than the others, that's something that inevitably happens. It's that it feels like nothing in the problem statement, or part 1, tried to direct me towards whatever branch of math this solution requires. Unless listing 3 primes (10007, 119315717514047, 101741582076661) and overflow is meant to be enough hints?

2

u/zedrdave Dec 24 '19

It's that it feels like nothing in the problem statement, or part 1, tried to direct me towards whatever branch of math this solution requires

Worse than that: that Haley's comet reference, while it might have been a hint at modular arithmetic, contributed to sending me chasing the red herring of periodicity (similar to a past day problem)… :-|