MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / solution

Function solution

project_euler/problem_079/sol1.py:56–66  ·  view source on GitHub ↗

Returns the shortest possible secret passcode of unknown length for successful login attempts given by `input_file` text file. >>> solution("keylog_test.txt") 6312980

(input_file: str = "keylog.txt")

Source from the content-addressed store, hash-verified

54
55
56def solution(input_file: str = "keylog.txt") -> int:
57 """
58 Returns the shortest possible secret passcode of unknown length
59 for successful login attempts given by `input_file` text file.
60
61 >>> solution("keylog_test.txt")
62 6312980
63 """
64 logins = Path(__file__).parent.joinpath(input_file).read_text().splitlines()
65
66 return find_secret_passcode(logins)
67
68
69if __name__ == "__main__":

Callers 1

sol1.pyFile · 0.70

Calls 1

find_secret_passcodeFunction · 0.85

Tested by

no test coverage detected