Clean up
This commit is contained in:
1 parent
b53e041014
commit
120a015fbf
1 file changed
+4
-6
@@ -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