python easy solution
```\nclass Solution:\n    def threeEqualParts(self, A: List[int]) -> List[int]:\n        n = len(A)\n        ones = []\n        for i in range(n):\n            
```\nclass Solution:\n    def threeEqualParts(self, A: List[int]) -> List[int]:\n        n = len(A)\n        ones = []\n        for i in range(n):\n            if A[i]: ones.append(i)\n        none = len(ones)\n        if none == 0: return [0, n-1]\n        if none % 3: return [-1, -1]\n        g = none // 3\n        i, j = ones[g-1], ones[2*g -1]\n        pre_zero = n-1 - ones[-1]\n        if ones[g] - ones[g-1]-1 < pre_zero or ones[2*g]-ones[2*g-1]-1 < pre_zero: \n            return [-1, -1]\n        \n        i += pre_zero\n        j += pre_zero\n        k = n-1\n        ans = [i, j+1]\n        for _ in range(g):\n            if not (A[k]==A[j]==A[i]): return [-1, -1]\n            k -=1\n            j -= 1\n            i -= 1\n        return ans\n
[]