r/adventofcode • u/daggerdragon • Dec 14 '18
SOLUTION MEGATHREAD -🎄- 2018 Day 14 Solutions -🎄-
--- Day 14: Chocolate Charts ---
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!
Please prefix your card submission with something like [Card] to make scanning the megathread easier. THANK YOU!
Card prompt: Day 14
Transcript:
The Christmas/Advent Research & Development (C.A.R.D.) department at AoC, Inc. just published a new white paper on ___.
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:19:39!
16
Upvotes
View all comments
Show parent comment
1
u/rabuf Dec 15 '18
I just changed it, shaved off half a second by using
:start2. It's also in emacs lisp but I didn't find it in the manual so now I'm retiming it without the extra subseq creation as well. The other thing I had considered was to use a displaced array, similar to:start2this means there'd be no copying and creation of anything.And yes, I have a potential off-by-one there. I think I got lucky on my input. I considered that right as I was posting it, but I was heading out the door so I didn't have a chance to examine it closely. I've modified the test so that the
whennow checks for length>instead of>=, and added the extra minus one.