leetcode Nim Game . https://leetcode.com/problems/nim-game/
尼姆游戏,自己先手,每次可以取1-3块石子
解题思路: n%4==0 自己输,n%4!=0 别人输
public boolean canWinNim(int n) {
if(n%4==0){
return false;
}
return true;
}
leetcode Nim Game . https://leetcode.com/problems/nim-game/
尼姆游戏,自己先手,每次可以取1-3块石子
解题思路: n%4==0 自己输,n%4!=0 别人输
public boolean canWinNim(int n) {
if(n%4==0){
return false;
}
return true;
}