[C++] O(n) time, O(1) space, 12 ms with explanation & comments
Algorithm:\n\t1) Count no. of 1\'s in the given array, say countNumberOfOnes.\n\t2) If no 1 is found ie. countNumberOfOnes == 0, just return {0,size-1}\n\t3) If
Algorithm:\n\t1) Count no. of 1\'s in the given array, say ```countNumberOfOnes```.\n\t2) If no 1 is found ie. ```countNumberOfOnes == 0```, just return ```{0,size-1}```\n\t3) If ``` countNumberOfOnes % 3 != 0``` , then we cannot partition the given array for sure. This is because, there is no way to put equal no. of 1\'s in any partition and hence, we will get different binary representations.\n\t4) Let\'s try to find if there is a valid partition possible now. We find the first 1 in the given array and represent it\'s position by ```start```.\n\t5) Also, we know that each partition must have ``` countNumberOfOnes/3 ``` (for same reason as given in step 3). Therefore, after finding the first 1, leave  ```k = countNumberOfOnes/3 ``` 1\'s for the first partition.\n\t6) Assign this position as ```mid``` that denotes the beginning of a possible second partition.\n\t7) Further leave ```k = countNumberOfOnes/3 ``` 1\'s for this partition and assign the beginning of last partition as ```end```\n\t8) Now, all we need to do is verify whether all the partitions have same values in them. This can be done by iterating through to the end of the array.\n\t9) If ```end``` doesn\'t reach the end of the array, we find a mismatch and hence, we need to return ```{-1, -1}```\n\t10) Otherwise, we have found our partition, return ```{start-1,mid}```\n\nTime Complexity: ```O(n)```\nSpace Complexity: ```O(1)```\n\n```\nstatic int x=[](){ios::sync_with_stdio(false); cin.tie(NULL); return 0;}();\n\nclass Solution {\npublic:\n    vector<int> threeEqualParts(vector<int>& A) {\n\t    // Count no of 1\'s in the given array\n        int countNumberOfOnes = 0;\n        for(int c: A)\n            if(c == 1)                  \n                countNumberOfOnes++;\n\t\t\t\t\t\t\t\t\n\t    // If no 1 is found, that means we can return ans as {0, size-1}\n        if(countNumberOfOnes == 0)      \n            return {0, A.size()-1};\n\t\t\t\t\t\t\n        // If no of 1\'s is not a multiple of 3, then we can never find a possible partition since\n        // there will be atkeast one partition that will have different no of 1\'s and hence\n        // different binary representation\n        // For example,\n        // Given :\n        // 0000110  110  110 \n        //       |  |    |\n        //       i       j\n        // Total no of ones = 6\n        // 0000110         110      110\n        //     |           |        |\n        //     start       mid      end\n        // Match starting from first 1, and putting 2 more pointers by skipping k 1\'s\n        \n        if(countNumberOfOnes % 3 != 0)            \n            return {-1, -1};\n\t\t\t\t\t\t\n        // find size of each partition\n        int k = countNumberOfOnes/3;\n        int i;\n        \n        // find the first 1 in the array\n        for(i=0;i<A.size(); i++)\n            if(A[i] == 1)\n                break;\n        int start = i;\n        \n        // find (k+1)th 1 in the array\n        int count1 = 0;\n        for(i=0;i<A.size(); i++)\n        {\n            if(A[i] == 1)\n                count1++;\n            if(count1 == k + 1)\n                break;\n        }\n        int mid = i;\n        \n        //find (2*k +1)th 1 in the array\n        count1= 0;\n        for(i=0;i<A.size(); i++)\n        {\n            if(A[i] == 1)\n                count1++;\n            if(count1 == 2*k + 1)\n                break;\n        }\n        int end = i;\n        \n        // Match all values till the end of the array\n        while(end< A.size() && A[start] == A[mid] && A[mid] == A[end])\n        {\n            start++; mid++; end++;\n        }\n        \n        // Return appropriate values if all the values have matched till the end\n        if(end == A.size()) \n            return {start-1, mid};\n        \n        // otherwise, no such indices found\n        return {-1, -1};\n    }\n};\n\n```\nCode written during contest, may be optimized further. :-)
[]