aoc2022/d06/part1.py

9 lines
192 B
Python
Raw Normal View History

2022-12-06 15:27:05 +00:00
import sys
L = sys.stdin.read()
for (i, (a,b,c,d)) in enumerate(zip(L,L[1:],L[2:],L[3:])):
if not (b == a or c == a or c == b or d == a or d == b or d == c):
print(i+4, L[i:i+4])
break