Bests Java Solution || Beats 80%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n\n    public boolean winnerOfGame(String s) {\n        int n = s.length();\n        if(n<=2) return false;\n\n        int A = 0;\n        int B = 0;\n\n        for(int i=1; i<n-1; i++){\n            char ch = s.charAt(i);\n            char a = s.charAt(i-1);\n            char b = s.charAt(i+1);\n            if(ch==\'A\' && ch==a && ch==b) A++;\n            if(ch==\'B\' && ch==a && ch==b) B++;\n        }\n        if(A>B) return true;\n        else return false;\n    }\n}\n```
['Java']