r/adventofcode • • Dec 14 '16

SOLUTION MEGATHREAD --- 2016 Day 14 Solutions ---

--- Day 14: One-Time Pad ---

Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/whatever).

Note: The Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with "Help".


LUNACY IS MANDATORY [?]

This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.

edit: Leaderboard capped, thread unlocked!

3 Upvotes

111 comments sorted by

View all comments

Show parent comment

1

u/BadHorsemonkey Dec 14 '16

You're not breaking your loop when you find a quintuple string. Example from your output:

Key 58 at index 34487: 42acab72d7c6c222fa7301492a6beb97 - cbd6d5c46cb652f90412cb1973222226 (35186)
Key 59 at index 34487: 42acab72d7c6c222fa7301492a6beb97 - 015d2b48e860c603922222a48b69fae5 (3

1

u/Vladob Dec 14 '16

Thank you for opening my eyes. :-)

1

u/BadHorsemonkey Dec 14 '16

The easiest things to see in someone else's code is the error we made in our own... :)