✅100%🔥Kotlin🔥Easy Solution
Intuition\nThe goal is to determine the winner of the game where Alice and Bob take alternating turns removing pieces with specific color conditions. Alice can 
# Intuition\nThe goal is to determine the winner of the game where Alice and Bob take alternating turns removing pieces with specific color conditions. Alice can only remove a piece colored \'A\' if both of its neighbors are also \'A\', and Bob can only remove a piece colored \'B\' under the same condition. The player who cannot make a move on their turn loses the game. To find the winner, we count consecutive \'A\'s and \'B\'s in the string and compare the counts.\n# Approach\n1. Calculate the length of the input string `n`.\n2. If `n` is less than or equal to 2, return false because there are not enough pieces to play the game.\n3. Initialize variables `count_alice` and `count_bob` to keep track of valid moves for Alice and Bob, respectively.\n4. Initialize variables `count_A` and `count_B` to count consecutive \'A\'s and \'B\'s.\n5. Iterate through the string from left to right:\n   - If the current character is \'A\':\n     - Increment `count_A` and reset `count_B` to 0.\n     - If `count_A` reaches 3 or more, increment `count_alice`.\n   - If the current character is \'B\':\n     - Increment `count_B` and reset `count_A` to 0.\n     - If `count_B` reaches 3 or more, increment `count_bob`.\n6. After the loop, compare `count_alice` and `count_bob` to determine the winner.\n   - If `count_alice` is greater than `count_bob`, return true, indicating Alice wins.\n   - Otherwise, return false, indicating Bob wins or it\'s a draw.\n\n# Complexity\n- Time complexity: O(n)\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    fun winnerOfGame(colors: String): Boolean {\n        val n = colors.length\n        if(n<=2){\n            return false\n        }\n        var count_alice = 0\n        var count_bob = 0\n        var count_A = 0\n        var count_B = 0\n        for(i in 0 until n){\n            if(colors[i] == \'A\'){\n                count_A++\n                count_B = 0\n                if(count_A >= 3) count_alice++\n            }else{\n                count_B++    \n                count_A = 0\n                if(count_B >= 3) count_bob++\n            }\n            \n        }\n        if(count_alice > count_bob){\n            return true\n        }else{\n            return false\n        }\n    }\n}\n```
['Kotlin']