✅Simplest Solution 🤎 Y O U  #TGM
\n Describe your first thoughts on how to solve this problem. \n\n\n# Approach\n Describe your approach to solving the problem. \nStep-1 -> Intialize Alice and 
\n<!-- Describe your first thoughts on how to solve this problem. -->\n<i>\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nStep-1 -> Intialize Alice and Bob and iterate over input array from 1st index to last but one to avoid array index out of bounds exception \nStep-2 -> Start comparing previous current and next elements if all of them found \'A\' increment Alice, all of them found \'B\' increment Bob\nStep-3 -> Return true if Alice is greater than Bob (which means Alice won else return false)\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n// 16ms\nclass Solution {\n    public boolean winnerOfGame(String s) {\n        // AAA -> Alice++ || BBB ->> Bob++ return true if Alice win\n        int  Alice = 0;\n        int Bob = 0;\n        for(int i=1; i<s.length()-1; i++){\n            if(s.charAt(i-1)==s.charAt(i) && s.charAt(i)==s.charAt(i+1)){\n                if(s.charAt(i)==\'A\') Alice++;\n                else Bob++;\n            }\n        }\n        return Alice > Bob ? true : false;\n    }\n}\n```\n```\n// 7ms\nclass Solution {\n    public boolean winnerOfGame(String s) {\n        // AAA -> Alice++ || BBB ->> Bob++ return true if Alice win\n        int  Alice = 0;\n        int Bob = 0;\n        int AliceTemp = 0;\n        int BobTemp = 0;\n        for(char ch : s.toCharArray()){\n            if(ch==\'A\'){\n                BobTemp = 0;\n                AliceTemp++;\n                if(AliceTemp >= 3) Alice++;\n            }else{\n                AliceTemp = 0;\n                BobTemp++;\n                if(BobTemp >= 3) Bob++;\n            }\n        }\n        return Alice > Bob ? true : false;\n    }\n}\n```
['String', 'Java']