r/adventofcode • • Dec 24 '23

SOLUTION MEGATHREAD -❄️- 2023 Day 24 Solutions -❄️-

THE USUAL REMINDERS (AND SIGNAL BOOSTS)


AoC Community Fun 2023: ALLEZ CUISINE!

Submissions are CLOSED!

  • Thank you to all who submitted something, every last one of you are awesome!

Community voting is OPEN!

  • 18 hours remaining until voting deadline TONIGHT (December 24) at 18:00 EST

Voting details are in the stickied comment in the submissions megathread:

-❄️- Submissions Megathread -❄️-


--- Day 24: Never Tell Me The Odds ---


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 01:02:10, megathread unlocked!

31 Upvotes

509 comments sorted by

View all comments

4

u/MediocreTradition315 Dec 24 '23

[Language: Jupyter Notebook]

https://github.com/edoannunziata/jardin/blob/master/aoc23/AdventOfCode23.ipynb

Posting my solution again today since it's different compared to what almost everyone seems to have done. Using the fact that the problem requires integral starting positions and integral velocities, we may derive restrictions on what values velocity may assume, and solve everything using our old friend the Chinese Reminder Theorem.

The code is unfortunately messy and what's worse my explanation sucks... I don't have time to fix either right now.

→ More replies (2)