Python Solution: brief explain
Intuition\n Describe your first thoughts on how to solve this problem. \nAccording to the rules:\n 1. Alice is only allowed to remove a piece colored \'A\' if b
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nAccording to the rules:\n `1. Alice is only allowed to remove a piece colored \'A\' if both its neighbors are also colored \'A\'. She is not allowed to remove pieces that are colored \'B\'.`\n`2. Bob is only allowed to remove a piece colored \'B\' if both its neighbors are also colored \'B\'. He is not allowed to remove pieces that are colored \'A\'.`\n`3. Alice and Bob cannot remove pieces from the edge of the line.` \nThe first and second rules force to players to pick the letter surronded by same letters. On the other words, at least middle letter of AAA or BBB can be choosed. \nThe third one do not allow to pick the boundry string. This means AA or BB in the edge will not be considerd. \nThe only option is to choose a middle letter in string AAA or BBB. It can also be AAAA or BBBB and so on. Therefore,the question should be equal to find a substring that length >=3. \n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nFind the substring length that should be larger than 2. \n\n\n# Code\n```\nclass Solution(object):\n    def winnerOfGame(self, colors):\n        """\n        :type colors: str\n        :rtype: bool\n        """\n        ## find substring in colors, length >=3\n        A = colors.split(\'B\')\n        B = colors.split(\'A\')\n        ## got the number of A/B each substring can pick  \n        lena = [len(i)-2 for i in A if len(i)>=3] \n        lenb = [len(j)-2 for j in B if len(j)>=3]\n        # sum the total steps \n        goA = sum(lena)\n        goB = sum(lenb)\n        # alice first,so the steps of alice should be larger than bob\n        if goA > goB:\n            return True\n        else:\n            return False \n        \n```
['Python']