C++ || EASY
\n\npublic:\n    vector threeEqualParts(vector& arr) {\n         int i,first,second,third,count=0,one=0;\n        for(i=0;i<arr.size();i++)\n        {\n        
```\n\n```public:\n    vector<int> threeEqualParts(vector<int>& arr) {\n         int i,first,second,third,count=0,one=0;\n        for(i=0;i<arr.size();i++)\n        {\n            if(arr[i]==1)\n            {\n                count++;\n            }\n        }\n        if(count==0)\n        {\n            return {0,2};\n        }\n        if(count%3!=0)\n        {\n            return {-1,-1};\n        }\n       int  n=count/3;\n        for(i=0;i<arr.size();i++)\n        {\n            if(arr[i]==1)\n            {\n                one++;\n                if(one==1)\n                {\n                    first=i;\n                }\n                else if(one==n+1)\n                {\n                    second=i;\n                }\n                else if(one==(2*n)+1)\n                {\n                    third=i;\n                }\n            }\n        }\n        while(third<arr.size())\n        {\n            if(arr[first]==arr[second]&&arr[second]==arr[third])\n            {\n                first++;\n                second++;\n                third++;\n            }\n            else\n            {\n                return {-1,-1};\n            }\n        }\n        return {first-1,second};\n    }\n};
[]