C++
class Solution {
public:
bool canWinNim(int n) {
if(n%4==0)
return false;
else
return true;
}
};
最优解
简化bool
Paste_Image.pngclass Solution {
public:
bool canWinNim(int n) {
if(n%4==0)
return false;
else
return true;
}
};
简化bool
Paste_Image.png本文标题:292. Nim Game
本文链接:https://www.haomeiwen.com/subject/pbblpttx.html
网友评论