Java consider 2 cases
I think it take liner time compixity.\nI consider alice take one case or take two case\n\n    public boolean stoneGameIX(int[] stones) {\n        int size = sto
I think it take liner time compixity.\nI consider alice take one case or take two case\n```\n    public boolean stoneGameIX(int[] stones) {\n        int size = stones.length;\n        int[] mod1 = new int[3];\n        for (int i = 0; i < size; i++) {\n            mod1[stones[i] % 3] += 1;\n        }\n        int[] mod2 = Arrays.copyOf(mod1, 3);\n        return get(mod1, size, 1) || get(mod2, size, 2);\n    }\n\n    public boolean get(int[] mod, int n, int startVal) {\n        if (mod[startVal] == 0) {\n            return false;\n        }\n        int sum = startVal;\n        mod[startVal]--;\n        for (int i = 1; i < n; i++) {\n            if (mod[0] > 0 && sum % 3 != 0) {\n                mod[0]--;\n            } else if (mod[1] > 0 && (sum + 1) % 3 != 0) {\n                sum += 1;\n                mod[1]--;\n            } else if (mod[2] > 0 && (sum + 2) % 3 != 0) {\n                sum += 2;\n                mod[2]--;\n            } else {\n                // odd -> bob turn, alice win; even -> alice turn, bob win\n                if(i % 2 == 0){\n                    return false;\n                }else{\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n```
['Java']