Golang one pass O(1) memory
We can thow away any even number of stones with stones[i]%3==0 because player wi winning strategy can play it\'s game until opponent not take stones[i]%3==0 and
1. We can thow away any even number of stones with stones[i]%3==0 because player wi winning strategy can play it\'s game until opponent not take stones[i]%3==0 and at next move take stones[j]%3==0\n2. If we hane no stones divisable by 3, Alice strategy is take more deficite stone by first move. She wins always except all stones with the same modulo 3.\n3. If we have one stone%3==0 (odd number of them), Alice should take most popular modulo by first move and take stone%3==0 only if she have no other moves. Alice wins if abs(cnt2-cnt1)>2\n\n\n```\nfunc stoneGameIX(stones []int) bool {\n    rest:=make([]int,3)\n    for _,v := range stones {\n        rest[v%3]++\n    }\n    if rest[1]<rest[2] {\n        rest[1],rest[2] = rest[2],rest[1]\n    }\n    if rest[0] %2 == 0 {\n        if rest[2] == 0 {\n            return false\n        }\n        return true\n    } \n    return rest[1] - rest[2]>2\n}\n```
[]