21 lines
515 B
Python
21 lines
515 B
Python
import hashlib
|
|
import itertools
|
|
from typing import Any, Iterator
|
|
|
|
from ..base import BaseSolver
|
|
|
|
|
|
class Solver(BaseSolver):
|
|
def solve(self, input: str) -> Iterator[Any]:
|
|
it = iter(itertools.count(1))
|
|
yield next(
|
|
i
|
|
for i in it
|
|
if hashlib.md5(f"{input}{i}".encode()).hexdigest().startswith("00000")
|
|
)
|
|
yield next(
|
|
i
|
|
for i in it
|
|
if hashlib.md5(f"{input}{i}".encode()).hexdigest().startswith("000000")
|
|
)
|