Easy C++ Solution with comments
\nclass Solution {\npublic:\n    vector<int> threeEqualParts(vector<int>& arr) {\n        // count 1\n        int countone=count(arr.begin(),arr.end(),1);\n    
```\nclass Solution {\npublic:\n    vector<int> threeEqualParts(vector<int>& arr) {\n        // count 1\n        int countone=count(arr.begin(),arr.end(),1);\n        int n=arr.size();\n        if(countone%3)\n        {\n            return {-1,-1};\n        }\n        if(countone==0)\n        {\n            return {0,n-1};\n        }\n        int total=countone/3;\n        int p1=0,p2=0,p3=0;\n        int count=0;\n        // check first occurance of 1 for each part\n        // lets take example\n        //1 0 0 0 1 0 1 0 1 0 0 0 0 1 0 1\n        for(int i=0;i<n;i++)\n        {\n            if(arr[i]==1)\n            {\n                if(count==0)\n                {\n                    p1=i;\n                }\n                else if(count==total)\n                {\n                    p2=i;\n                }\n                else if(count==2*total)\n                {\n                    p3=i;\n                }\n                count+=1;\n            }\n        }\n        // after this\n        // p1 at index 0,p2 at index 6 and p3 at index 13\n        // now check all element after of each part\n        while(p3<n-1)\n        {\n            p1+=1;\n            p2+=1;\n            p3+=1;\n            if(arr[p1]!=arr[p2] || arr[p2]!=arr[p3] || arr[p1]!=arr[p3])//if not equal \n            {\n                return {-1,-1};\n            }\n        }\n        \n        return {p1,p2+1};\n        \n    } \n};\n```
['C', 'C++']