[Python] Counting elements
\n\nclass Solution(object):\n    def stoneGameIX(self, stones):\n        \n        S = [0, 0, 0]\n        for s in stones:\n            S[s % 3] += 1\n         
```\n\nclass Solution(object):\n    def stoneGameIX(self, stones):\n        \n        S = [0, 0, 0]\n        for s in stones:\n            S[s % 3] += 1\n                    \n        if S[1] == S[2]:\n            if S[1] == 0:\n                return False\n            elif S[0] % 2 == 1:\n                return False\n            else:\n                return True\n        else:\n            if S[1] == 0 or S[2] == 0:\n                if S[1] < 3 and S[2] < 3:\n                    return False\n                elif S[0] % 2 == 1:\n                    return True\n                else:\n                    return False\n            elif abs(S[1] - S[2]) > 2:\n                return True\n            else:\n                if S[0] % 2 == 1:\n                    return False\n                else:\n                    return True\n\t\t\t\t\t\n```
[]