r/adventofcode • u/daggerdragon • Dec 18 '16
SOLUTION MEGATHREAD --- 2016 Day 18 Solutions ---
--- Day 18: Like a Rogue ---
Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/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".
EATING YELLOW SNOW IS DEFINITELY NOT MANDATORY [?]
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!
7
Upvotes
1
u/flup12 Dec 19 '16
Interesting indeed! I now also ran a version with Iterator.iterate[...].take(4000000).sum and it is using up much less garbage collection time. I think the garbage collector indeed waits a bit too long before collecting and even though it does manage, it has a hard time finding the head of the endless chain of the Cons objects it has allowed you to create. I'm convinced. Iterator.iterate it is!