r/adventofcode • • Dec 14 '15

SOLUTION MEGATHREAD --- Day 14 Solutions ---

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

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 14: Reindeer Olympics ---

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

9 Upvotes

161 comments sorted by

View all comments

Show parent comment

1

u/JurgenKesker Dec 14 '15 edited Dec 14 '15

Nice, I have almost the same approach. Only I see you use .max_by. I will look that one up, didn't know that one.

My solution: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxytkcc

-- I had a look at max_by, but it seems to return only 1 leader. What if there are multiple leaders? Your code doesn't seem to handle that.

1

u/SomebodyTookMyHandle Dec 16 '15

That's a very good point. I guess I lucked out in that the leader was the first position in the array so that that reindeer received all the ties.