Merge branch 'youngyangyang04:master' into master

This commit is contained in:
XuBoLun
2021-08-24 12:56:55 +08:00
committed by GitHub
3 changed files with 16 additions and 3 deletions

View File

@ -296,7 +296,7 @@ class Solution {
} }
``` ```
Python Python
```py ```python
class Solution: class Solution:
def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]: def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]:
res = [] res = []

View File

@ -93,10 +93,10 @@ class Solution:
if not root: if not root:
return [] return []
quene = [root] queue = [root]
out_list = [] out_list = []
while quene: while queue:
length = len(queue) length = len(queue)
in_list = [] in_list = []
for _ in range(length): for _ in range(length):

View File

@ -210,7 +210,20 @@ var reverseString = function(s) {
}; };
``` ```
Swift:
```swift
func reverseString(_ s: inout [Character]) {
var l = 0
var r = s.count - 1
while l < r {
// 使用元祖
(s[l], s[r]) = (s[r], s[l])
l += 1
r -= 1
}
}
```