292. Nim 游戏

Table of Contents

1 题目

2 代码

class Solution {

    /**
     * @param Integer $n
     * @return Boolean
     */
    function canWinNim($n) {
        return $n%4 != 0;
    }
}

3 思路

这个看答案了

看一下这个讲解 https://leetcode-cn.com/problems/nim-game/solution/java-bu-jiang-qi-yin-qiao-ji-zhi-shuo-kuang-jia-xi/

其中包括

  • 递归
  • 记忆化搜索
  • 从输出中查找规律

===

作者: 吴丹阳 https://www.cnblogs.com/wudanyang

更新时间: 2020-09-14 Mon 13:32

Emacs 28.0.50 (Org mode 9.3.7)

===

天行健,君子以自强不息。

地势坤,君子以厚德载物。

===

相关文章:

  • 2022-12-23
  • 2021-09-26
  • 2021-10-24
  • 2022-12-23
  • 2022-02-20
猜你喜欢
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
  • 2021-10-31
  • 2021-09-02
  • 2022-01-15
  • 2021-09-24
相关资源
相似解决方案