C++ greedy
The only thing horrifying in this problem is its tag hard and its proof which we don\'t have to do by the way.: )\n\nclass Solution {\npublic:\n    vector<int> 
The only thing horrifying in this problem is its tag hard and its proof which we don\'t have to do by the way.: )\n```\nclass Solution {\npublic:\n    vector<int> threeEqualParts(vector<int>& a) {\n        int one=0;\n        int n=a.size();\n        for(auto it:a)if(it)one++;\n        if(one==0)\n            return vector<int>{0,n-1};\n        if(one%3)\n            return vector<int>{-1,-1};\n        int k=one/3;\n        vector<int> pos;\n        int t=0;\n        for(int i=0;i<n;i++)\n        {\n            if(a[i])\n                t++;\n            if(t==1 and a[i]==1)\n                pos.push_back(i);\n            if(t==k)t=0;\n        }\n        int st=pos[0],mid=pos[1],en=pos[2];\n        cout<<"st= "<<st<<" mid= "<<mid<<" en= "<<en<<endl;\n        while(en<n and a[st]==a[mid] and a[mid]==a[en])\n            en++,st++,mid++;\n        if(en==n)\n            return vector<int>{st-1,mid};\n        return vector<int>{-1,-1};\n    }\n};\n```
['C']