very intuitive || with explanation
see first divide the whole array in three parts first remainder 1 , second remainder 2 and third remainder 0 ...... now see what remainder 0 work is its work is
see first divide the whole array in three parts first remainder 1 , second remainder 2 and third remainder 0 ...... now see what remainder 0 work is its work is to switch the positions between alice and bob like if bob is working on remainder 1 it will start to work on remainder 2 now if alice choosed remainder 0 element in her chance ...... and this is a big hint which after which you all can build up the inituition ........\n// code \n\nclass Solution {\npublic:\n    bool stoneGameIX(vector<int>& stones) {\n     int count1=0;\n        int count2=0;\n        int count0=0;\n        for(int i=0;i<stones.size();i++){\n            if(stones[i]%3==1){\n                count1++;\n            }\n            else if(stones[i]%3==2){\n                count2++;\n            }\n            else{\n                count0++;\n            }\n        }\n        if(count1==0 && count2==0){\n            return false;\n        }\n        if(count1==0 || count2==0){\n            if(count1==1|| count2==1 || count1==2 || count2==2){\n                return false;\n            }\n            if(count0%2){\n                return true;\n            }\n            else{\n                return false;\n            }\n        }\n        if(count1==count2){\n            if(count0%2){\n                return false;\n            }\n            else{\n                return true;\n            }\n        }\n        else{\n            if(count0%2){\n                int min_val=min(count1,count2);\n                int max_val=max(count1,count2);\n                if(max_val-2<=min_val){\n                    return false;\n                }\n                else{\n                    return true;\n                }\n            }\n            else{\n                return true;\n            }\n        }\n    }\n};
['Greedy', 'C']