r/adventofcode • u/daggerdragon • Dec 09 '15
SOLUTION MEGATHREAD --- Day 9 Solutions ---
This thread will be unlocked when there are a significant amount of people on the leaderboard with gold stars.
edit: Leaderboard capped, achievement 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 9: All in a Single Night ---
Post your solution as a comment. Structure your post like previous daily solution threads.
10
Upvotes
View all comments
Show parent comment
1
u/willkill07 Dec 09 '15
Here's another C++ / C++11 / C++14 implementation:
I don't keep track of the paths at all. Just an overall min/max. I also avoid the need to do the (b,a) lookup by exploiting std::minmax to give them to me in the proper order I inserted them.
https://github.com/willkill07/adventofcode/blob/master/src/day9/day9.cpp