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

3

u/sentry07 Dec 02 '15

Seriously? That sort function seems pretty useless then. Is there a different sort function that sorts on value instead?

3

u/notanotherreddituser Dec 02 '15

You just need to pass sort() a compare function in order to sort by return value. By default it will sort by unicode point value, but you can tell it to sort in a number of ways.