Java Solution using Sliding Window
\nclass Solution {\n    public boolean winnerOfGame(String colors) {\n        int countA = 0;\n        int countB = 0;\n        \n        for (int i = 0; i < co
```\nclass Solution {\n    public boolean winnerOfGame(String colors) {\n        int countA = 0;\n        int countB = 0;\n        \n        for (int i = 0; i < colors.length() - 2; i++) {\n            char c1 = colors.charAt(i);\n            char c2 = colors.charAt(i + 1);\n            char c3 = colors.charAt(i + 2);\n            \n            if (c1 == c2 && c2 == c3 && c1 == \'A\') {\n                countA++;\n            }\n            \n            if (c1 == c2 && c2 == c3 && c1 == \'B\') {\n                countB++;\n            }\n        }\n        \n        return countA > countB;\n    }\n}\n```
['Sliding Window', 'Java']