r/adventofcode • • Dec 03 '16

SOLUTION MEGATHREAD --- 2016 Day 3 Solutions ---

--- Day 3: Squares With Three Sides ---

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


DECKING THE HALLS WITH BOUGHS OF HOLLY IS 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!

17 Upvotes

234 comments sorted by

View all comments

Show parent comment

2

u/gerikson Dec 03 '16 edited Dec 03 '16

Nice reformulation but the for the size of the input I doubt it will make that much difference...

Also, is finding the max really that much faster than sorting for 3 elements?

I used idiomatic Perl with a sort for every candidate triple and part 2 runs in around a 10th of a second on a shared Unix box.

Edit wording