Java | String | Counting | Simple Solution
\nclass Solution {\n    public boolean winnerOfGame(String colors) {\n        int as=0,bs=0;        \n        for (int i=1;i<colors.length()-1;i++) {\n         
```\nclass Solution {\n    public boolean winnerOfGame(String colors) {\n        int as=0,bs=0;        \n        for (int i=1;i<colors.length()-1;i++) {\n            if(colors.charAt(i-1)==\'A\' && colors.charAt(i)==\'A\' && colors.charAt(i+1)==\'A\') \n                as++;\n            if(colors.charAt(i-1)==\'B\' && colors.charAt(i)==\'B\' && colors.charAt(i+1)==\'B\') \n                bs++;\n        }\n        return as>bs;\n    }\n}\n```\nKindly upvote if you like the code.
['String', 'Counting', 'Java']