C++ (Clean, Commented for easy understanding)
\n/*\n\tSuch approaches don\'t come to our minds in one go. I had taken help for this solution. Tried to put\n\tcomments so that others can understand well.\n\t
```\n/*\n\tSuch approaches don\'t come to our minds in one go. I had taken help for this solution. Tried to put\n\tcomments so that others can understand well.\n\tPersonally, Leetcode\'s solution to this Qn and explanation are not written well. It seems like\n\ta mess and unreadable. I have tried to explain it with comments\n*/\nclass Solution {\npublic:\n    vector<int> threeEqualParts(vector<int>& arr) {\n        int n = arr.size();\n        int sum = accumulate(begin(arr), end(arr), 0);\n        \n        if(sum == 0)\n            return {0, n-1};\n        else if(sum%3 != 0)\n            return {-1, -1};\n        \n        int k = sum/3;\n        //So every partition must have k 1\'s\n        //So let\'s find three partitions having k 1\'s and compare them bit by bit\n        \n        int start = -1, mid = -1, end = -1;\n        int count = 0;\n\n        //[1,  1,  1,  0,  0,  1,  1,  0,  1,  0,  1,  1,  1,  1,  1,  1]\n        for(int i = 0; i<n; i++) {\n            if(arr[i] == 0) continue;\n            \n            count += arr[i];\n            if(count > k) {\n                count = 1;\n            }\n            \n            if(count == 1) {\n                if(start == -1) start = i;\n                else if(mid == -1) mid = i;\n                else if(end == -1) end = i;\n                else break;\n            }\n        }\n        \n        /*\n            we have found three sections and we have pointers to starting \'1\' of\n            each section.\n            we now compare them bit by bit\n        */\n        \n        while(end < n && arr[start] == arr[mid] && arr[mid] == arr[end]) {\n            start++;  mid++;   end++;\n        }\n        \n        //It means we couldn\'t match all sections\n        if(end != n)  return {-1, -1};\n        \n        return {start-1, mid};\n    }\n};\n```
[]