Intuitive Python Solution (Tc: O(n) Sc: O(1))
Intuition\nSince the game is turn-based, whoever has the greatest number of matching sequences will win the game. Therefore, you only need to iterate through th
# Intuition\nSince the game is turn-based, whoever has the greatest number of matching sequences will win the game. Therefore, you only need to iterate through the loop once to determine who has the most matching sequences.\n\n# Approach\nWe iterate through the list once, starting from the second piece and stopping at the second-to-last piece (because these are the only pieces that can be extracted). Whenever we come upon "AAA", we increment Alice\'s counter, and whenever we happen upon "BBB", we increment Bob\'s counter. Finally, we compare Alice\'s count with Bob\'s count. If aliceWins > bobWins, Alice wins the game, so we return the result of that comparison directly.\n\n# Complexity\n- Time complexity:\nO(n) because only iterating through the loop once\n\n- Space complexity:\nO(1) because memory remains constant\n\n# Code\n```\nclass Solution(object):\n    def winnerOfGame(self, colors):\n        aliceWins, bobWins = 0, 0\n        for i in range(1, len(colors) - 1):\n            consecutiveColors = colors[i-1:i+2]\n            if consecutiveColors == "AAA":\n                aliceWins += 1\n            elif consecutiveColors == "BBB":\n                bobWins += 1\n        return aliceWins > bobWins\n        \n```
['Python']