Update readme and lib and start 2015.

This commit is contained in:
2024-01-27 22:56:28 -05:00
parent b88d839bc1
commit d32bd4c04b
9 changed files with 181 additions and 6 deletions

22
2015/d4.py Normal file
View File

@@ -0,0 +1,22 @@
from lib import *
import hashlib
part_1 = True
if part_1:
digits = 5
else:
digits = 6
data = open(0).read().strip()
for i in range(10**9):
text = data + str(i)
md5_hash = hashlib.md5(text.encode()).hexdigest()
for c in md5_hash[:digits]:
if c != "0":
break
else:
print(i)
break