eASy sOlutioN iN cPp.
IntuitionApproachComplexity
Time complexity:O(n)

Space complexity:O(1)
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    bool winnerOfGame(string colors) {
        if(colors.size() <= 2)
        {
            return false;
        }
        int alice=0,bob=0,n1=0,n2=0;
        for(int j=0;j<colors.size();j++)
        {
            if(colors[j] == 'A')
            {
                if(n2 >= 3)
                {
                    bob=bob+(n2-2);
                }
                n2=0;
                n1+=1;
            }
            if(colors[j] == 'B')
            {
                if(n1 >= 3)
                {
                    alice=alice+(n1-2);
                }
                n1=0;
                n2+=1;
            }
        }
        if(n1 >= 3)
        {
            alice+=(n1-2);
        }
        if(n2 >= 3)
        {
            bob+=(n2-2);
        }
        return alice > bob;
    }
};
```
['Math', 'String', 'Greedy', 'Game Theory', 'C++']