You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
524 B
26 lines
524 B
import re
|
|
import argparse
|
|
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("filename", help="the file from which to take data")
|
|
args = parser.parse_args()
|
|
|
|
with open(args.filename, "r") as f: contents = f.read()
|
|
|
|
buffer = contents[:4]
|
|
for (i, s) in enumerate(contents[3:]):
|
|
buffer = buffer[1:] + s
|
|
|
|
print(buffer)
|
|
if len(set(buffer)) == 4:
|
|
print(i+4)
|
|
break
|
|
|
|
buffer = contents[:14]
|
|
for (i, s) in enumerate(contents[13:]):
|
|
buffer = buffer[1:] + s
|
|
|
|
print(buffer)
|
|
if len(set(buffer)) == 14:
|
|
print(i+14)
|
|
break |