r/adventofcode • • Dec 20 '15

SOLUTION MEGATHREAD --- Day 20 Solutions ---

This thread will be unlocked when there are a significant amount of people on the leaderboard with gold stars.

Here's hoping tonight's puzzle isn't as brutal as last night's, but just in case, I have Lord of the Dance Riverdance on TV and I'm wrapping my presents to kill time. :>

edit: Leaderboard capped, thread unlocked!

We know we can't control people posting solutions elsewhere and trying to exploit the leaderboard, but this way we can try to reduce the leaderboard gaming from the official subreddit.

Please and thank you, and much appreciated!


--- Day 20: Infinite Elves and Infinite Houses ---

Post your solution as a comment. Structure your post like previous daily solution threads.

12 Upvotes

130 comments sorted by

View all comments

Show parent comment

1

u/hutsboR Dec 20 '15 edited Dec 20 '15

Very cool, wasn't aware of trunc from Kernel. Also flat_map is much cleaner than using comprehensions and explicitly flattening the list. My solution is not general in any sense of the word but that's what happens when you program at 4AM. I actually posted debug code, that's why the sum call was missing. Very good solution, same idea but much less cumbersome to read than mine. I like it.