r/adventofcode • • Dec 16 '15

SOLUTION MEGATHREAD --- Day 16 Solutions ---

This thread will be unlocked when there are a significant amount of people on the leaderboard with gold stars.

edit: Leaderboard capped, 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 16: Aunt Sue ---

Post your solution as a comment. Structure your post like previous daily solution threads.

4 Upvotes

142 comments sorted by

View all comments

Show parent comment

1

u/tftio Dec 16 '15 edited Dec 16 '15

comp' is wrong -- it's not propagating None correctly. The patterns should be:

None, _ | _, None -> None
Some i, Some i' -> Some (f' i i')

... as, because I'm using None to mean unknown, either value being None means the whole operation is None (because x = None has to be None, for all values of x). The way that the data was constructed, this didn't come up, but it still bugged me enough to make note of it.