Ruby with Regexp
\ndef three_equal_parts(a)\n  return [0, a.size-1] if a.all?(&:zero?)\n  s = a.join\n  tmp = s.match(/^0*(1.*)0*(\\1)0*(\\1)$/)[1]\n  i = s.index(tmp) + tmp.siz
```\ndef three_equal_parts(a)\n  return [0, a.size-1] if a.all?(&:zero?)\n  s = a.join\n  tmp = s.match(/^0*(1.*)0*(\\1)0*(\\1)$/)[1]\n  i = s.index(tmp) + tmp.size - 1\n  j = s.index(tmp, i+1) + tmp.size\n  [ i , j ]\nrescue => e\n  [-1, -1]\nend\n```
[]