def sectors(arr):
l, last = 0, len(arr) - 1
while l < last:
l = arr[l+1:].index(arr[0]) + l + 1
if last % l != 0:
continue
for i in range(last // l):
if arr[0:l] != arr[l * i: l * (i + 1)]:
break
else:
break
return l
print(sectors([1,1,1,1,]))
ZGVmIHNlY3RvcnMoYXJyKToKCWwsIGxhc3QgPSAwLCBsZW4oYXJyKSAtIDEKCXdoaWxlIGwgPCBsYXN0OgoJCWwgPSBhcnJbbCsxOl0uaW5kZXgoYXJyWzBdKSArIGwgKyAxCgkJaWYgbGFzdCAlIGwgIT0gMDoKCQkJY29udGludWUKCQlmb3IgaSBpbiByYW5nZShsYXN0IC8vIGwpOgoJCQlpZiBhcnJbMDpsXSAhPSBhcnJbbCAqIGk6IGwgKiAoaSArIDEpXToKCQkJCWJyZWFrCgkJZWxzZToKCQkJYnJlYWsKCXJldHVybiBsCgkKcHJpbnQoc2VjdG9ycyhbMSwxLDEsMSxdKSk=