python O(n) 108ms
``` class Solution:     def threeEqualParts(self, A):         """         :type A: List[int]         :rtype: List[int]         """         N = len(A)         if
```
class Solution:
    def threeEqualParts(self, A):
        """
        :type A: List[int]
        :rtype: List[int]
        """
        N = len(A)
        if N < 3:
            return [-1, -1]
        
        num_ones = sum(A)
				
        if num_ones % 3 != 0:
            return [-1, -1]
        
        if num_ones == 0:
            return [0, 2]
        
        need_ones = num_ones // 3
        str_input_reverse = ''.join(map(str, reversed(A)))
        count_1 = 0
        i = 0
        while count_1 != need_ones:
            if str_input_reverse[i] == '1':
                count_1 += 1
            i += 1
            
        second = str_input_reverse.find(str_input_reverse[:i], i)
        if(second == -1):
            return [-1, -1]
        third = str_input_reverse.find(str_input_reverse[:i], second + i)
        if(third == -1):
            return [-1, -1]
        return [N - 1 - third, N - second]
```
[]