C++ - Math
\n\n# Code\n\nclass Solution {\npublic:\n    bool stoneGameIX(vector<int>& stones) {\n        vector<int> mod(3,0);\n        for (auto s: stones) mod[s%3]++;\n\
\n\n# Code\n```\nclass Solution {\npublic:\n    bool stoneGameIX(vector<int>& stones) {\n        vector<int> mod(3,0);\n        for (auto s: stones) mod[s%3]++;\n\n        int mi = min(mod[1],mod[2]);\n        int ma = max(mod[1],mod[2]);\n        //cout << mod[0] << "-" << mod[1] << "-" << mod[2] << endl;\n        if (mi==0 && ma>2) return mod[0]%2==1;\n        else if (mi==0) return false;\n        \n        return mod[0]%2==0 || ma>mi+2;\n        \n    }\n};\n```
['C++']