javascript greedy 112ms
\nconst stoneGameIX = (a) => {\n    let f = Array(3).fill(0);\n    for (const x of a) f[x % 3]++;\n    f[0] %= 2;\n    if (f[0] == 0) {\n        if (f[1] == 0 |
```\nconst stoneGameIX = (a) => {\n    let f = Array(3).fill(0);\n    for (const x of a) f[x % 3]++;\n    f[0] %= 2;\n    if (f[0] == 0) {\n        if (f[1] == 0 || f[2] == 0) {\n            return false;\n        }\n        return true;\n    }\n    return Math.abs(f[1] - f[2]) <= 2 ? false : true;\n};\n```
['Greedy', 'JavaScript']