6-2 fertig
This commit is contained in:
51
06/06-2.py
Normal file
51
06/06-2.py
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user