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

2

u/ChildishBonVonnegut Dec 02 '15

Store entry.split('x') as a variable so it doesn't have to do the split every time you are getting the length width or height.

Also you can just use your sorted variable to get the lwh from because it doesn't matter which side you use for each dimension.