VERY EASY AND FAST APPROACH-(O(N))
Intuition\n Describe your first thoughts on how to solve this problem. \nThe number of moves a player can make doesn\'t depend on what the other player does.\n\
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe number of moves a player can make doesn\'t depend on what the other player does.\n\nIf a group of n consecutive pieces has the same color, the player can take n - 2 of those pieces if n is greater than or equal to 3\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nJust Implement the Intution\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n```\nO(N)\n```\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n```\nO(1)\n```\n\n# Code\n```\nclass Solution {\npublic:\n    bool winnerOfGame(string colors) {\n        int a=0;\n        int b=0;\n        bool alice=colors[0]==\'A\'?1:0;\n        int count=1;\n        for(int i=1;i<colors.size();i++){\n            if(alice){\n                if(colors[i]==\'A\'){\n                    count++;\n                }\n                else{\n                    alice=0;\n                    if(count>=3){\n                        a=a+count-2;\n                    }\n                    count=1;\n                }\n            }\n            else{\n                if(colors[i]==\'B\'){\n                    count++;\n                }\n                else{\n                    alice=1;\n                    if(count>=3)b=b+count-2;\n                    count=1;\n                }\n            }\n        }\n        if(count>=3){\n            if(colors[colors.size()-1]==\'A\')a+=count-2;\n            else b+=count-2;\n        }\n        if(a>b)return 1;\n        return 0;\n    }\n};\n```
['C++']