1. Add the building util of Python

for the markdown docs.
2. Update the deploy.sh
This commit is contained in:
krahets
2023-02-06 23:23:21 +08:00
parent 64f251f933
commit ea901af217
28 changed files with 292 additions and 933 deletions

View File

@ -70,14 +70,7 @@ comments: true
=== "Python"
```python title="leetcode_two_sum.py"
class SolutionBruteForce:
def twoSum(self, nums: List[int], target: int) -> List[int]:
# 两层循环,时间复杂度 O(n^2)
for i in range(len(nums) - 1):
for j in range(i + 1, len(nums)):
if nums[i] + nums[j] == target:
return i, j
return []
[class]{SolutionBruteForce}-[func]{}
```
=== "Go"
@ -247,16 +240,7 @@ comments: true
=== "Python"
```python title="leetcode_two_sum.py"
class SolutionHashMap:
def twoSum(self, nums: List[int], target: int) -> List[int]:
# 辅助哈希表,空间复杂度 O(n)
dic = {}
# 单层循环,时间复杂度 O(n)
for i in range(len(nums)):
if target - nums[i] in dic:
return dic[target - nums[i]], i
dic[nums[i]] = i
return []
[class]{SolutionHashMap}-[func]{}
```
=== "Go"