Files
aoc/06/f.py

21 lines
397 B
Python

import os
input = open(os.path.dirname(__file__) +
"/input.txt", "r").read()
index, index1, index2 = 0, 0, 0
buf = []
def findUniq(length):
ind = 0
for x in input:
ind += 1
if len(set(input[ind:ind+length])) == length:
return ind+length
return False
print("First answer: " + str(findUniq(4)))
print("Second answer: " + str(findUniq(14)))