当前位置:网站首页>LeetCode 292. Nim Game (Simple)
LeetCode 292. Nim Game (Simple)
2022-08-10 05:55:00 【Shengxin Research Ape】
python
class Solution:def canWinNim(self, n: int) -> bool:# If your opponent gives you 4 stones at the end, you must lose.#So the total number of stones cannot be a multiple of 4, otherwise no matter how many you take, you can control the number of stones to a multiple of 4 in the back hand.return n%4 != 0
边栏推荐
猜你喜欢
随机推荐
LeetCode 100.相同的树(简单)
Day1 微信小程序-小程序代码的构成
ORACLE system table space SYSTEM is full and cannot expand table space problem solving process
开源免费WMS仓库管理系统【推荐】
pytorch-11.卷积神经网络(高级篇)
R语言聚类分析——代码解析
pytorch-09.多分类问题
力扣——统计只差一个字符的子串数目
generic notes()()()
Batch add watermark to pictures batch scale pictures to specified size
堆的原理与实现以及排序
分享一款恋爱星座男女配对微信小程序源码
wiki confluence installation
事务、存储引擎
LeetCode 1351.统计有序矩阵中的负数(简单)
Set Sources Resources and other folders in the IDEA project
String常用方法
Database Notes Create Database, Table Backup
Using sqlplus to operate database in shell script
GUI_AWT









