Advent-of-Code/2015/day 4/P2/AdventCoins.py

7 lines
163 B
Python
Raw Permalink Normal View History

2019-12-01 17:44:00 +01:00
import hashlib
key = open("input.txt").read().replace("\n", "")
num=0
while hashlib.md5(f"{key}{num}".encode()).hexdigest()[:6] != "000000":
num+=1
print(num)