Day 6 answer 1

This commit is contained in:
2022-12-06 07:21:22 +02:00
parent c5d4b8066b
commit 6b716bf476

19
06/f.py Normal file
View File

@@ -0,0 +1,19 @@
import os
input = open(os.path.dirname(__file__) +
"/input.txt", "r").read()
index = 0
index2 = 0
buf = []
for x in input:
index += 1
index2 += 1
buf.append(x)
if len(buf) == 4:
if len(set(buf)) == 4:
break
else:
buf.pop(0)
print(index)