diff --git a/2015/4/coin.py b/2015/4/coin.py new file mode 100644 index 0000000..1f45e10 --- /dev/null +++ b/2015/4/coin.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +import sys, hashlib +key = sys.stdin.readline().strip() + +def findmd5(n): + result = " " + i = 0 + while result[:n] != "0" * n: + i = i + 1 + result = hashlib.md5((key + str(i)).encode('utf-8')).hexdigest() + return i + +print(findmd5(5), findmd5(6))