Question about the problem
Is there a reason why my code isnt returning the desired output leetCode wants,\nI assumed that Alice or Bob will pick the first stone that when added to the su
Is there a reason why my code isnt returning the desired output leetCode wants,\nI assumed that Alice or Bob will pick the first stone that when added to the sum wont be divisible by 3, and it\'s working how I anticipated, can anyone explain what optimall means in the description?\n\nThank you\n\n```\nclass Solution {\n    public boolean stoneGameIX(int[] stones) {\n         //Whatever Alice plays if its only one stone, she is destined to lose\n\t\t if(stones.length == 1)\n             return false;\n\t\t\t \n        return helper(stones,0,true);\n    }\n    \n    public boolean helper(int[] stones, int sum,boolean turn){\n        //if not stones are left and the game hasn\'t stopped until now , Bob automaticlly wins\n\t\tif(stones.length == 0)\n            return false;\n        \n            // creating another array with one less stone\n        int[] temp = new int[stones.length-1];\n        \n\t\t//checking for a stone that when added to the sum, it isnt divisible by 3\n        for(int i = 0 ; i< stones.length;i++){\n            if((stones[i]+sum)%3 != 0){\n                int k = 0;\n\t\t\t\t\n\t\t\t\t//filling the temp array\n                for(int j = 0 ; j<temp.length;j++){\n                    if(j == i){\n                          k++;\n                    }\n                    temp[j] = stones[j+k];\n                }\n\t\t\t\t//continuing the game\n            return true && helper(temp,sum+stones[i],!turn);\n            }\n    }\n\t  //if every stone when added to sum is divisble by 3 then the current player loses\n        return !turn;\n  }\n}\n```
[]