[LeetCode] Nim Game

Haha, an interesting problem. Just try to let your opponent start with a number that is an integer multiple of 4.

1 class Solution {
2 public:
3     bool canWinNim(int n) {
4         return n % 4;
5     }
6 };

 

posted @ 2015-10-13 16:41  jianchao-li  阅读(207)  评论(0编辑  收藏  举报