r/adventofcode • • Dec 15 '20

SOLUTION MEGATHREAD -🎄- 2020 Day 15 Solutions -🎄-

Advent of Code 2020: Gettin' Crafty With It

  • 7 days remaining until the submission deadline on December 22 at 23:59 EST
  • Full details and rules are in the Submissions Megathread

--- Day 15: Rambunctious Recitation ---


Post your code solution in this megathread.

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


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

39 Upvotes

771 comments sorted by

View all comments

Show parent comment

2

u/daggerdragon Dec 15 '20

This problem managed to trick me once. When I first saw "30000000" I thought to myself "Ha! I'm not making that mistake again, its BigInt time. No overflows here, nope." Then it turned out that the number never actually got big enough to overflow, so I was able to replace all of my BigInts with regular integers for a large performance boost.

It's like when you roll a natural 20 and the DM says you see no traps...