Merge branch 'youngyangyang04:master' into master

This commit is contained in:
hailincai
2021-10-26 07:02:44 -04:00
committed by GitHub
4 changed files with 20 additions and 4 deletions

View File

@ -286,7 +286,7 @@ class Solution {
```
### Python
```python3
```python
class Solution:
def solveSudoku(self, board: List[List[str]]) -> None:
"""

View File

@ -156,6 +156,17 @@ class Solution {
## Python
```python
class Solution:
def sortByBits(self, arr: List[int]) -> List[int]:
arr.sort(key=lambda num: (self.count_bits(num), num))
return arr
def count_bits(self, num: int) -> int:
count = 0
while num:
num &= num - 1
count += 1
return count
```
## Go

View File

@ -430,7 +430,11 @@ N皇后问题分析
同样也感谢录友们的坚持,这也是我持续写作的动力,**正是因为大家的积极参与,我才知道这件事件是非常有意义的**。
最后希望大家可以转发这篇文章给身边的朋友们,因为还有很多学习算法的小伙伴依然在浩如烟海的信息中迷茫,而我相信「代码随想录」会让大家少走弯路!
回溯专题汇聚为一张图:
![](https://code-thinking-1253855093.file.myqcloud.com/pics/20211025180652.png)
这个图是 [代码随想录知识星球](https://mp.weixin.qq.com/s/QVF6upVMSbgvZy8lHZS3CQ) 成员:莫非毛,所画,总结的非常好,分享给大家。
**回溯算法系列正式结束,新的系列终将开始,录友们准备开启新的征程!**