Moved 2022 to own dir
This commit is contained in:
15
2022/06/f.py
Normal file
15
2022/06/f.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import os
|
||||
|
||||
input = open(os.path.dirname(__file__) +
|
||||
"/input.txt", "r").read()
|
||||
|
||||
|
||||
def findUniq(length: int):
|
||||
for i in range(len(input)):
|
||||
if len(set(input[i:i+length])) == length:
|
||||
return i+length
|
||||
return -1
|
||||
|
||||
|
||||
print("First answer: " + str(findUniq(4)))
|
||||
print("Second answer: " + str(findUniq(14)))
|
||||
Reference in New Issue
Block a user