Nim Game

来源:互联网 发布:redis 数据丢失 编辑:程序博客网 时间:2024/05/09 06:22

c++

class Solution {public:    bool canWinNim(int n) {        return n % 4 > 0;    }};

python

class Solution(object):    def canWinNim(self, n):        """        :type n: int        :rtype: bool        """        return n%4 > 0
0 0
原创粉丝点击