21 lines
373 B
Python
21 lines
373 B
Python
from common import parse
|
|
|
|
|
|
def all_different_characters(input: str) -> bool:
|
|
return all(map(lambda c: input.count(c) == 1, input))
|
|
|
|
|
|
def solve(input: str) -> int:
|
|
i = 0
|
|
while i < len(input) and not all_different_characters(input[i : i + 4]):
|
|
i += 1
|
|
return i + 4
|
|
|
|
|
|
def main():
|
|
print(solve(parse("input")))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|