[C++] Easy, Clean Solution
Solution:\n\nclass Solution {\npublic:\n    vector<int> threeEqualParts(vector<int>& ar) {\n        int cnt0 = 0, cnt1 = 0;\n        for(auto i: ar){\n         
**Solution:**\n```\nclass Solution {\npublic:\n    vector<int> threeEqualParts(vector<int>& ar) {\n        int cnt0 = 0, cnt1 = 0;\n        for(auto i: ar){\n            if(i)\n                cnt1++;\n            else\n                cnt0++;\n        }\n        \n        if(cnt1 % 3 != 0)\n            return {-1, -1};\n        else\n        {\n            if(cnt1 == 0){\n                return {0, 2};\n            }\n            else{\n                int k = cnt1 / 3;\n                int one = 0, two = 0, three = 0;\n                int cnt = 0;\n                for(int i = 0; i < ar.size(); i++){\n                    if(ar[i]){\n                        if(cnt == 0)\n                            one = i;\n                        cnt++;\n                        \n                        if(cnt == k + 1)\n                            two = i;\n                        \n                        if(cnt == 2 * k + 1){\n                            three = i;\n                            break;\n                        }\n                    }\n                }\n                \n                //now we have 3 indices.......\n                //check if each increment in the indices results in similar integer 0/1....\n                \n                while(1){\n                    if(ar[one] != ar[two] or ar[two] != ar[three] or three == ar.size())\n                        break;\n                    \n                    one++;\n                    two++;\n                    three++;\n                }\n                \n                if(three == ar.size())\n                    return {one - 1, two};\n                else\n                    return {-1, -1};\n            }     \n        }\n    }\n};\n```
['Bit Manipulation', 'C']