Python Easy Understand Solution With Explanation
The idea is pretty straight forward, you just need some obervation before coding.\n1. If the solution exists, the number of 1 in list should be times of 3.\n2. 
The idea is pretty straight forward, you just need some obervation before coding.\n1. If the solution exists, the number of 1 in list should be times of 3.\n2. Since the ending zeros affect the binary value ([1,1] != [1,1, 0]) and the leading zeros mean nothing, we can find the value of each part (I called potential in the following code) if we scan the list from the end to the beginning.\n3. After we find this number, things become easier. we just need to find the effective points of each part (I mean the position of first 1), we can locate the end of each part. Then the answer is just some calculation.\n```\ndef threeEqualParts(self, A):\n        """\n        :type A: List[int]\n        :rtype: List[int]\n        """\n        c1 = A.count(1)\n        if c1%3: return [-1, -1]\n        if c1 == 0: return [0, len(A)-1]\n        n1 = c1/3\n        potential = []\n        count = 0\n\t\t\t\t# find the value of each part\n        for a in A[::-1]:\n            potential.insert(0, a)\n            if a == 1:\n                count += 1\n                if count == n1:\n                    break\n        lp = len(potential)\n        temp = []\n        i = 0\n\t\t\t\t# find the effective beginning of each part\n        while i < (len(A)-lp):\n            if A[i] == 1 and A[i:i+lp] == potential:\n                temp.append(i)\n                i += lp\n            elif A[i] == 0:\n                i += 1\n            else:\n                return [-1, -1]\n        ans = [temp[0]+lp-1, temp[1]+lp]\n        return ans\n```
[]