mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 03:34:02 +08:00
Merge branch 'youngyangyang04:master' into master
This commit is contained in:
@ -296,7 +296,7 @@ class Solution {
|
||||
}
|
||||
```
|
||||
Python:
|
||||
```py
|
||||
```python
|
||||
class Solution:
|
||||
def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]:
|
||||
res = []
|
||||
|
@ -93,10 +93,10 @@ class Solution:
|
||||
if not root:
|
||||
return []
|
||||
|
||||
quene = [root]
|
||||
queue = [root]
|
||||
out_list = []
|
||||
|
||||
while quene:
|
||||
while queue:
|
||||
length = len(queue)
|
||||
in_list = []
|
||||
for _ in range(length):
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user