mirror of
https://github.com/Xevion/advent-of-code.git
synced 2025-12-11 16:06:31 -06:00
2015 day 4 part 1 & 2
This commit is contained in:
1
2015/day-4/input
Normal file
1
2015/day-4/input
Normal file
@@ -0,0 +1 @@
|
|||||||
|
bgvyzdsv
|
||||||
16
2015/day-4/python/main.py
Normal file
16
2015/day-4/python/main.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import hashlib
|
||||||
|
|
||||||
|
PATH = os.path.join(sys.path[0], '..', 'input')
|
||||||
|
SALT = 'bgvyzdsv'
|
||||||
|
md5 = hashlib.md5()
|
||||||
|
|
||||||
|
i = 0
|
||||||
|
while True:
|
||||||
|
md5.update((SALT + str(i)).encode())
|
||||||
|
if md5.hexdigest().startswith('00000'):
|
||||||
|
print(i)
|
||||||
|
break
|
||||||
|
i += 1
|
||||||
Reference in New Issue
Block a user