未验证 提交 c60cb17e 编写于 作者: J Jody Zhou 提交者: GitHub

Update 一行代码解决的智力题.md

上级 fee8d2e2
......@@ -152,7 +152,8 @@ int bulbSwitch(int n) {
======其他语言代码======
[JodyZ0203](https://github.com/JodyZ0203)提供 292. Nim 游戏 Python3 解法代码:
```Python3
```Python
class Solution:
def canWinNim(self, n: int) -> bool:
# 如果除于是0,说明是4的倍数,所以必输
......@@ -161,7 +162,8 @@ class Solution:
```
[JodyZ0203](https://github.com/JodyZ0203)提供 877. 石子游戏 Python3 解法代码:
```Python3
```Python
class Solution:
def stoneGame(self, piles: List[int]) -> bool:
# 双方都很聪明的前提下, 先手必胜无疑
......@@ -170,6 +172,7 @@ class Solution:
```
[JodyZ0203](https://github.com/JodyZ0203)提供 877. 石子游戏 C++ 解法代码:
```cpp
class Solution {
public:
......@@ -182,7 +185,8 @@ public:
[JodyZ0203](https://github.com/JodyZ0203)提供 319. 灯泡开关 Python3 解法代码:
```Python3
```Python
class Solution:
def bulbSwitch(self, n: int) -> int:
# 平方根电灯个数之后向下取整即可
......@@ -190,6 +194,7 @@ class Solution:
```
[JodyZ0203](https://github.com/JodyZ0203)提供 319. 灯泡开关 C++ 解法代码:
```cpp
class Solution {
public:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册