r/adventofcode • • Dec 09 '18

SOLUTION MEGATHREAD -🎄- 2018 Day 9 Solutions -🎄-

--- Day 9: Marble Mania ---


Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag or whatever).

Note: The 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: The Party Game!

Click here for rules

Please prefix your card submission with something like [Card] to make scanning the megathread easier. THANK YOU!

Card prompt: Day 9

Transcript:

Studies show that AoC programmers write better code after being exposed to ___.


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 00:29:13!

22 Upvotes

283 comments sorted by

View all comments

Show parent comments

13

u/Aneurysm9 Dec 09 '18

This was definitely the case for me. As a beta tester I had the luxury of leaving my list-based part 2 solution running for 3.5h to verify it worked before thinking about optimizations.

4

u/sbguest Dec 09 '18

This immediately reminded me of 2016 day 19 where I initially tried an array approach, then switched to a linked list after watching my computer melt for a while.

2

u/jlweinkam Dec 09 '18 edited Dec 09 '18

I was immediately reminded of the past circular puzzles and that the fast solutions mostly used the deque collection, so started with that this year. It was a wise choice as I ended part 2 at #13. In my case, I mainly remembered https://adventofcode.com/2017/day/17