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):
|
def findUniq(length):
|
||||||
ind = 0
|
for i in range(len(input)):
|
||||||
for x in input:
|
if len(set(input[i:i+length])) == length:
|
||||||
ind += 1
|
return i+length
|
||||||
if len(set(input[ind:ind+length])) == length:
|
return -1
|
||||||
return ind+length
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
print("First answer: " + str(findUniq(4)))
|
print("First answer: " + str(findUniq(4)))
|
||||||
|
|||||||
Reference in New Issue
Block a user