52 lines
1.1 KiB
Python
52 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
data = ""
|
|
|
|
# parse input
|
|
input_file = open("input", "r")
|
|
for line in input_file:
|
|
line = line.strip()
|
|
data += line
|
|
input_file.close()
|
|
|
|
# data = "mjqjpqmgbljsphdztnvjfqwrcgsmlb"
|
|
# data = "bvwbjplbgvbhsrlpgdmjqwftvncz"
|
|
# data = "nppdvjthqldpwncqszvftbrmjlhg"
|
|
# data = "nznrnfrfntjfmvfwmzdfjlvtqnbhcprsg"
|
|
# data = "zcfzfwzzqfrljwzlrfnpqdbhtmscgvjw"
|
|
|
|
print(data)
|
|
|
|
for i in range(len(data)-13):
|
|
sub = data[i:i+14]
|
|
if sub.count(sub[0]) > 1:
|
|
continue
|
|
elif sub.count(sub[1]) > 1:
|
|
continue
|
|
elif sub.count(sub[2]) > 1:
|
|
continue
|
|
elif sub.count(sub[3]) > 1:
|
|
continue
|
|
elif sub.count(sub[4]) > 1:
|
|
continue
|
|
elif sub.count(sub[5]) > 1:
|
|
continue
|
|
elif sub.count(sub[6]) > 1:
|
|
continue
|
|
elif sub.count(sub[7]) > 1:
|
|
continue
|
|
elif sub.count(sub[8]) > 1:
|
|
continue
|
|
elif sub.count(sub[9]) > 1:
|
|
continue
|
|
elif sub.count(sub[10]) > 1:
|
|
continue
|
|
elif sub.count(sub[11]) > 1:
|
|
continue
|
|
elif sub.count(sub[12]) > 1:
|
|
continue
|
|
else:
|
|
print(i+14)
|
|
break
|