AdventOfCode/days6-10/day6/day6_part1.py

4 lines
244 B
Python
Raw Normal View History

2022-12-24 22:45:15 +00:00
with open('input.txt', 'r') as f:
stream = f.read()
print([i+4 for i in range(len(stream)) if i < (len(stream)-4) and stream[i] not in stream[i + 1:i + 4] and stream[i + 1] not in stream[i + 2:i + 4] and stream[i + 2] != stream[i + 3]][0])