Clean up
This commit is contained in:
10
06/f.py
10
06/f.py
@@ -5,12 +5,10 @@ input = open(os.path.dirname(__file__) +
|
||||
|
||||
|
||||
def findUniq(length):
|
||||
ind = 0
|
||||
for x in input:
|
||||
ind += 1
|
||||
if len(set(input[ind:ind+length])) == length:
|
||||
return ind+length
|
||||
return False
|
||||
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)))
|
||||
|
||||
Reference in New Issue
Block a user