r/adventofcode • • Dec 04 '15

SOLUTION MEGATHREAD --- Day 4 Solutions ---

--- Day 4: The Ideal Stocking Stuffer ---

Post your solution as a comment. Structure your post like the Day Three thread.

14 Upvotes

272 comments sorted by

View all comments

Show parent comment

1

u/Adriaaan Dec 04 '15

My Perl one-liner:

$ cat input | perl -nl -MDigest::MD5=md5_hex -E '$i++ while md5_hex($_.$i)!~/^0{5,}/;print $i'

1

u/xdg Dec 04 '15

Beautiful!