Python 3, (削除) 96 (削除ここまで) (削除) 87 (削除ここまで) 85 bytes
def f(a):
c=p=0
for x in a:
if p*x:return
p|=x;c+=1
if c>=p>0:c=p=0
return p
-5 bytes thanks to 79037662.
-6 bytes thanks to HyperNeutrino.
None and positive are falsy, 0 is truthy.
Riolku
- 451
- 2
- 4