Skip to content

Commit 37e7d73

Browse files
Update
1 parent 266702c commit 37e7d73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+64
-60
lines changed

problems/0020.有效的括号.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class Solution {
159159
```
160160

161161
Python:
162-
```python3
162+
```python
163163
# 方法一,仅使用栈,更省空间
164164
class Solution:
165165
def isValid(self, s: str) -> bool:
@@ -180,7 +180,7 @@ class Solution:
180180
return True if not stack else False
181181
```
182182

183-
```python3
183+
```python
184184
# 方法二,使用字典
185185
class Solution:
186186
def isValid(self, s: str) -> bool:

problems/0027.移除元素.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class Solution {
142142

143143
Python:
144144

145-
```python3
145+
```python
146146
class Solution:
147147
"""双指针法
148148
时间复杂度:O(n)

problems/0035.搜索插入位置.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ func searchInsert(nums []int, target int) int {
246246
```
247247

248248
### Python
249-
```python3
249+
```python
250250
class Solution:
251251
def searchInsert(self, nums: List[int], target: int) -> int:
252252
left, right = 0, len(nums) - 1

problems/0039.组合总和.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class Solution {
264264

265265
## Python
266266
**回溯**
267-
```python3
267+
```python
268268
class Solution:
269269
def __init__(self):
270270
self.path = []
@@ -296,7 +296,7 @@ class Solution:
296296
self.path.pop() # 回溯
297297
```
298298
**剪枝回溯**
299-
```python3
299+
```python
300300
class Solution:
301301
def __init__(self):
302302
self.path = []

problems/0040.组合总和II.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class Solution {
334334

335335
## Python
336336
**回溯+巧妙去重(省去使用used**
337-
```python3
337+
```python
338338
class Solution:
339339
def __init__(self):
340340
self.paths = []
@@ -374,7 +374,7 @@ class Solution:
374374
sum_ -= candidates[i] # 回溯,为了下一轮for loop
375375
```
376376
**回溯+去重(使用used)**
377-
```python3
377+
```python
378378
class Solution:
379379
def __init__(self):
380380
self.paths = []

problems/0042.接雨水.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ class Solution:
491491
return res
492492
```
493493
动态规划
494-
```python3
494+
```python
495495
class Solution:
496496
def trap(self, height: List[int]) -> int:
497497
leftheight, rightheight = [0]*len(height), [0]*len(height)

problems/0046.全排列.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class Solution:
243243
usage_list[i] = False
244244
```
245245
**回溯+丢掉usage_list**
246-
```python3
246+
```python
247247
class Solution:
248248
def __init__(self):
249249
self.path = []

problems/0059.螺旋矩阵II.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ class Solution {
188188
}
189189
```
190190

191-
python:
191+
python3:
192192

193-
```python3
193+
```python
194194
class Solution:
195195

196196
def generateMatrix(self, n: int) -> List[List[int]]:

problems/0070.爬楼梯完全背包版本.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ class Solution {
143143
}
144144
```
145145

146-
Python
146+
Python3
147147

148148

149-
```python3
149+
```python
150150
class Solution:
151151
def climbStairs(self, n: int) -> int:
152152
dp = [0]*(n + 1)

problems/0077.组合优化.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class Solution {
174174
```
175175

176176
Python:
177-
```python3
177+
```python
178178
class Solution:
179179
def combine(self, n: int, k: int) -> List[List[int]]:
180180
res=[] #存放符合条件结果的集合

0 commit comments

Comments
 (0)