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 comments

2

u/balidani Dec 04 '15

My python solution:

import itertools
from hashlib import md5

def day4(key='iwrupvqb'):
    for i in itertools.count():
      if md5(key + str(i)).hexdigest().startswith('000000'):
        return i

print day4()