This commit is contained in:
parent
c199c0ab05
commit
ab1cc7feee
12
sixx.py
12
sixx.py
|
@ -1,11 +1,11 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from useful import *
|
from useful import *
|
||||||
|
|
||||||
ls = lines(open(0))
|
def n(l, x):
|
||||||
def n(l):
|
|
||||||
for i, _ in enumerate(l):
|
for i, _ in enumerate(l):
|
||||||
if len(list(set(l[i:i+4]))) == 4:
|
if len(list(set(l[i:i+x]))) == x:
|
||||||
return i+4
|
return i+x
|
||||||
|
|
||||||
ic([n(l) for l in ls])
|
ls = lines(open(0))
|
||||||
print(sum([n(l) for l in ls]))
|
print(sum([n(l, 4) for l in ls]))
|
||||||
|
print(sum([n(l, 14) for l in ls]))
|
||||||
|
|
Loading…
Reference in New Issue