r/adventofcode • • Dec 02 '15

Spoilers Day 2 solutions

Hi! I would like to structure posts like the first one in r/programming, please post solutions in comments.

15 Upvotes

161 comments sorted by

View all comments

Show parent comment

1

u/Arrem_ Dec 02 '15 edited Dec 02 '15

Ah nice, a Rust solution. :)

But yeah, at one point or another, you're gonna need a sort/comparison in there. Unless someone thinks of something truly magical. As for performance, I assume that a 3 input sorting network might be a tiny bit faster than a sort, but meh, it doesn't really matter here and the .sort() looks a bit cleaner.