, fee: i32) -> i32 {
diff --git "a/problems/\345\212\250\346\200\201\350\247\204\345\210\222-\350\202\241\347\245\250\351\227\256\351\242\230\346\200\273\347\273\223\347\257\207.md" "b/problems/\345\212\250\346\200\201\350\247\204\345\210\222-\350\202\241\347\245\250\351\227\256\351\242\230\346\200\273\347\273\223\347\257\207.md"
index 2b04b7b085..4df21fb761 100644
--- "a/problems/\345\212\250\346\200\201\350\247\204\345\210\222-\350\202\241\347\245\250\351\227\256\351\242\230\346\200\273\347\273\223\347\257\207.md"
+++ "b/problems/\345\212\250\346\200\201\350\247\204\345\210\222-\350\202\241\347\245\250\351\227\256\351\242\230\346\200\273\347\273\223\347\257\207.md"
@@ -471,21 +471,10 @@ public:
「代码随想录」值得推荐给身边每一位学习算法的朋友同学们,关注后都会发现相见恨晚!
-## 其他语言版本
-
-
-Java:
-
-
-Python:
-
-
-Go:
-
-
+
From 038d50957cff8e3e370a1812ff36afa5feb72945 Mon Sep 17 00:00:00 2001
From: jinbudaily <18336218010@163.com>
Date: Wed, 26 Jul 2023 15:58:53 +0800
Subject: [PATCH 11/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=200674.=E6=9C=80?=
=?UTF-8?q?=E9=95=BF=E8=BF=9E=E7=BB=AD=E9=80=92=E5=A2=9E=E5=BA=8F=E5=88=97?=
=?UTF-8?q?=20=E6=8E=92=E7=89=88=E6=A0=BC=E5=BC=8F=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...07\345\255\220\345\272\217\345\210\227.md" | 24 +++++++++----------
...22\345\242\236\345\272\217\345\210\227.md" | 18 +++++++-------
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git "a/problems/0300.\346\234\200\351\225\277\344\270\212\345\215\207\345\255\220\345\272\217\345\210\227.md" "b/problems/0300.\346\234\200\351\225\277\344\270\212\345\215\207\345\255\220\345\272\217\345\210\227.md"
index c58c3bf6c4..11cf13d9c5 100644
--- "a/problems/0300.\346\234\200\351\225\277\344\270\212\345\215\207\345\255\220\345\272\217\345\210\227.md"
+++ "b/problems/0300.\346\234\200\351\225\277\344\270\212\345\215\207\345\255\220\345\272\217\345\210\227.md"
@@ -33,7 +33,7 @@
## 算法公开课
-**《代码随想录》算法视频公开课:[动态规划之子序列问题,元素不连续!| LeetCode:300.最长递增子序列](https://www.bilibili.com/video/BV1ng411J7xP),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html)::[动态规划之子序列问题,元素不连续!| LeetCode:300.最长递增子序列](https://www.bilibili.com/video/BV1ng411J7xP),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
@@ -124,8 +124,8 @@ public:
## 其他语言版本
+### Java:
-Java:
```Java
class Solution {
public int lengthOfLIS(int[] nums) {
@@ -147,7 +147,7 @@ class Solution {
}
```
-Python:
+### Python:
DP
```python
@@ -189,7 +189,8 @@ class Solution:
return len(tails) # 返回递增子序列的长度
```
-Go:
+### Go:
+
```go
// 动态规划求解
func lengthOfLIS(nums []int) int {
@@ -248,7 +249,8 @@ func lengthOfLIS(nums []int ) int {
}
```
-Javascript
+### Javascript:
+
```javascript
const lengthOfLIS = (nums) => {
let dp = Array(nums.length).fill(1);
@@ -267,7 +269,7 @@ const lengthOfLIS = (nums) => {
};
```
-TypeScript
+### TypeScript:
```typescript
function lengthOfLIS(nums: number[]): number {
@@ -288,7 +290,8 @@ function lengthOfLIS(nums: number[]): number {
};
```
-Rust:
+### Rust:
+
```rust
pub fn length_of_lis(nums: Vec) -> i32 {
let mut dp = vec![1; nums.len() + 1];
@@ -307,13 +310,8 @@ pub fn length_of_lis(nums: Vec) -> i32 {
-
-
-
-
-
-
+
diff --git "a/problems/0674.\346\234\200\351\225\277\350\277\236\347\273\255\351\200\222\345\242\236\345\272\217\345\210\227.md" "b/problems/0674.\346\234\200\351\225\277\350\277\236\347\273\255\351\200\222\345\242\236\345\272\217\345\210\227.md"
index 8cc270ec64..0c5e64b34e 100644
--- "a/problems/0674.\346\234\200\351\225\277\350\277\236\347\273\255\351\200\222\345\242\236\345\272\217\345\210\227.md"
+++ "b/problems/0674.\346\234\200\351\225\277\350\277\236\347\273\255\351\200\222\345\242\236\345\272\217\345\210\227.md"
@@ -29,7 +29,7 @@
## 算法公开课
-**《代码随想录》算法视频公开课:[动态规划之子序列问题,重点在于连续!| LeetCode:674.最长连续递增序列](https://www.bilibili.com/video/BV1bD4y1778v),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[动态规划之子序列问题,重点在于连续!| LeetCode:674.最长连续递增序列](https://www.bilibili.com/video/BV1bD4y1778v),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
@@ -157,8 +157,7 @@ public:
## 其他语言版本
-
-Java:
+### Java:
> 动态规划:
```java
@@ -207,7 +206,7 @@ public static int findLengthOfLCIS(int[] nums) {
}
```
-Python:
+### Python:
DP
```python
@@ -261,7 +260,8 @@ class Solution:
return result
```
-Go:
+### Go:
+
> 动态规划:
```go
func findLengthOfLCIS(nums []int) int {
@@ -302,7 +302,8 @@ func findLengthOfLCIS(nums []int) int {
}
```
-Rust:
+### Rust:
+
```rust
pub fn find_length_of_lcis(nums: Vec) -> i32 {
if nums.is_empty() {
@@ -320,7 +321,7 @@ pub fn find_length_of_lcis(nums: Vec) -> i32 {
}
```
-Javascript:
+### Javascript:
> 动态规划:
```javascript
@@ -363,7 +364,7 @@ const findLengthOfLCIS = (nums) => {
};
```
-TypeScript:
+### TypeScript:
> 动态规划:
@@ -409,3 +410,4 @@ function findLengthOfLCIS(nums: number[]): number {
+
From 9b0c0f20dcc1fd75af00188a04886dee7adc8c60 Mon Sep 17 00:00:00 2001
From: jinbudaily <18336218010@163.com>
Date: Wed, 26 Jul 2023 16:07:52 +0800
Subject: [PATCH 12/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=200392.=E5=88=A4?=
=?UTF-8?q?=E6=96=AD=E5=AD=90=E5=BA=8F=E5=88=97=200718.=E6=9C=80=E9=95=BF?=
=?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=AD=90=E6=95=B0=E7=BB=84=201035.=E4=B8=8D?=
=?UTF-8?q?=E7=9B=B8=E4=BA=A4=E7=9A=84=E7=BA=BF=201143.=E6=9C=80=E9=95=BF?=
=?UTF-8?q?=E5=85=AC=E5=85=B1=E5=AD=90=E5=BA=8F=E5=88=97=20=E6=8E=92?=
=?UTF-8?q?=E7=89=88=E6=A0=BC=E5=BC=8F=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...55\345\255\220\345\272\217\345\210\227.md" | 16 +++++++++-------
...15\345\255\220\346\225\260\347\273\204.md" | 18 +++++++++---------
...70\344\272\244\347\232\204\347\272\277.md" | 17 +++++++++--------
...61\345\255\220\345\272\217\345\210\227.md" | 19 ++++++++++++-------
4 files changed, 39 insertions(+), 31 deletions(-)
diff --git "a/problems/0392.\345\210\244\346\226\255\345\255\220\345\272\217\345\210\227.md" "b/problems/0392.\345\210\244\346\226\255\345\255\220\345\272\217\345\210\227.md"
index c10114c05a..6342a41f00 100644
--- "a/problems/0392.\345\210\244\346\226\255\345\255\220\345\272\217\345\210\227.md"
+++ "b/problems/0392.\345\210\244\346\226\255\345\255\220\345\272\217\345\210\227.md"
@@ -28,9 +28,9 @@
两个字符串都只由小写字符组成。
-# 算法公开课
+## 算法公开课
-**《代码随想录》算法视频公开课:[动态规划,用相似思路解决复杂问题 | LeetCode:392.判断子序列](https://www.bilibili.com/video/BV1tv4y1B7ym/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[动态规划,用相似思路解决复杂问题 | LeetCode:392.判断子序列](https://www.bilibili.com/video/BV1tv4y1B7ym/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
@@ -149,8 +149,8 @@ public:
## 其他语言版本
+### Java:
-Java:
```java
class Solution {
public boolean isSubsequence(String s, String t) {
@@ -174,7 +174,8 @@ class Solution {
}
```
-Python:
+### Python:
+
```python
class Solution:
def isSubsequence(self, s: str, t: str) -> bool:
@@ -190,7 +191,7 @@ class Solution:
return False
```
-JavaScript:
+### JavaScript:
```javascript
const isSubsequence = (s, t) => {
@@ -213,7 +214,7 @@ const isSubsequence = (s, t) => {
};
```
-TypeScript:
+### TypeScript:
```typescript
function isSubsequence(s: string, t: string): boolean {
@@ -237,7 +238,7 @@ function isSubsequence(s: string, t: string): boolean {
};
```
-Go:
+### Go:
```go
func isSubsequence(s string, t string) bool {
@@ -266,3 +267,4 @@ func isSubsequence(s string, t string) bool {
+
diff --git "a/problems/0718.\346\234\200\351\225\277\351\207\215\345\244\215\345\255\220\346\225\260\347\273\204.md" "b/problems/0718.\346\234\200\351\225\277\351\207\215\345\244\215\345\255\220\346\225\260\347\273\204.md"
index 82bf4f59e2..18cc02407f 100644
--- "a/problems/0718.\346\234\200\351\225\277\351\207\215\345\244\215\345\255\220\346\225\260\347\273\204.md"
+++ "b/problems/0718.\346\234\200\351\225\277\351\207\215\345\244\215\345\255\220\346\225\260\347\273\204.md"
@@ -25,9 +25,7 @@
## 算法公开课
-**《代码随想录》算法视频公开课:[动态规划之子序列问题,想清楚DP数组的定义 | LeetCode:718.最长重复子数组](https://www.bilibili.com/video/BV178411H7hV),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
-
-
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[动态规划之子序列问题,想清楚DP数组的定义 | LeetCode:718.最长重复子数组](https://www.bilibili.com/video/BV178411H7hV),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
@@ -126,7 +124,7 @@ public:
* 时间复杂度:O(n × m),n 为A长度,m为B长度
* 空间复杂度:O(n × m)
-## 滚动数组
+### 滚动数组
在如下图中:
@@ -257,8 +255,8 @@ class Solution {
## 其他语言版本
+### Java:
-Java:
```java
// 版本一
class Solution {
@@ -300,7 +298,7 @@ class Solution {
}
```
-Python:
+### Python:
2维DP
```python
@@ -395,7 +393,8 @@ class Solution:
```
-Go:
+### Go:
+
```Go
func findLength(A []int, B []int) int {
m, n := len(A), len(B)
@@ -442,7 +441,7 @@ func max(a, b int) int {
}
```
-JavaScript:
+### JavaScript:
> 动态规划
@@ -489,7 +488,7 @@ const findLength = (nums1, nums2) => {
}
```
-TypeScript:
+### TypeScript:
> 动态规划:
@@ -544,3 +543,4 @@ function findLength(nums1: number[], nums2: number[]): number {
+
diff --git "a/problems/1035.\344\270\215\347\233\270\344\272\244\347\232\204\347\272\277.md" "b/problems/1035.\344\270\215\347\233\270\344\272\244\347\232\204\347\272\277.md"
index 7142d75c09..74e94c842f 100644
--- "a/problems/1035.\344\270\215\347\233\270\344\272\244\347\232\204\347\272\277.md"
+++ "b/problems/1035.\344\270\215\347\233\270\344\272\244\347\232\204\347\272\277.md"
@@ -19,7 +19,7 @@
## 算法公开课
-**《代码随想录》算法视频公开课:[动态规划之子序列问题,换汤不换药 | LeetCode:1035.不相交的线](https://www.bilibili.com/video/BV1h84y1x7MP),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[动态规划之子序列问题,换汤不换药 | LeetCode:1035.不相交的线](https://www.bilibili.com/video/BV1h84y1x7MP),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
@@ -82,8 +82,8 @@ public:
## 其他语言版本
+### Java:
-Java:
```java
class Solution {
public int maxUncrossedLines(int[] nums1, int[] nums2) {
@@ -106,7 +106,8 @@ Java:
}
```
-Python:
+### Python:
+
```python
class Solution:
def maxUncrossedLines(self, A: List[int], B: List[int]) -> int:
@@ -120,8 +121,7 @@ class Solution:
return dp[-1][-1]
```
-
-Golang:
+### Go:
```go
func maxUncrossedLines(A []int, B []int) int {
@@ -152,7 +152,7 @@ func max(a, b int) int {
}
```
-Rust:
+### Rust:
```rust
pub fn max_uncrossed_lines(nums1: Vec, nums2: Vec) -> i32 {
@@ -173,7 +173,7 @@ pub fn max_uncrossed_lines(nums1: Vec, nums2: Vec) -> i32 {
}
```
-JavaScript:
+### JavaScript:
```javascript
const maxUncrossedLines = (nums1, nums2) => {
@@ -196,7 +196,7 @@ const maxUncrossedLines = (nums1, nums2) => {
};
```
-TypeScript:
+### TypeScript:
```typescript
function maxUncrossedLines(nums1: number[], nums2: number[]): number {
@@ -224,3 +224,4 @@ function maxUncrossedLines(nums1: number[], nums2: number[]): number {
+
diff --git "a/problems/1143.\346\234\200\351\225\277\345\205\254\345\205\261\345\255\220\345\272\217\345\210\227.md" "b/problems/1143.\346\234\200\351\225\277\345\205\254\345\205\261\345\255\220\345\272\217\345\210\227.md"
index 68269b87c5..260b085e14 100644
--- "a/problems/1143.\346\234\200\351\225\277\345\205\254\345\205\261\345\255\220\345\272\217\345\210\227.md"
+++ "b/problems/1143.\346\234\200\351\225\277\345\205\254\345\205\261\345\255\220\345\272\217\345\210\227.md"
@@ -39,7 +39,7 @@
## 算法公开课
-**《代码随想录》算法视频公开课:[动态规划子序列问题经典题目 | LeetCode:1143.最长公共子序列](https://www.bilibili.com/video/BV1ye4y1L7CQ),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[动态规划子序列问题经典题目 | LeetCode:1143.最长公共子序列](https://www.bilibili.com/video/BV1ye4y1L7CQ),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
@@ -136,7 +136,7 @@ public:
## 其他语言版本
-Java:
+### Java:
```java
/*
@@ -207,8 +207,9 @@ class Solution {
}
```
-Python:
+### Python:
2维DP
+
```python
class Solution:
def longestCommonSubsequence(self, text1: str, text2: str) -> int:
@@ -252,7 +253,8 @@ class Solution:
```
-Go:
+### Go:
+
```Go
func longestCommonSubsequence(text1 string, text2 string) int {
t1 := len(text1)
@@ -283,7 +285,8 @@ func max(a,b int)int {
```
-Javascript:
+### JavaScript:
+
```javascript
const longestCommonSubsequence = (text1, text2) => {
let dp = Array.from(Array(text1.length+1), () => Array(text2.length+1).fill(0));
@@ -302,7 +305,7 @@ const longestCommonSubsequence = (text1, text2) => {
};
```
-TypeScript:
+### TypeScript:
```typescript
function longestCommonSubsequence(text1: string, text2: string): number {
@@ -326,7 +329,8 @@ function longestCommonSubsequence(text1: string, text2: string): number {
};
```
-Rust:
+### Rust:
+
```rust
pub fn longest_common_subsequence(text1: String, text2: String) -> i32 {
let (n, m) = (text1.len(), text2.len());
@@ -353,3 +357,4 @@ pub fn longest_common_subsequence(text1: String, text2: String) -> i32 {
+
From a0edc60d1fd08db91138daf430a97894a354bd98 Mon Sep 17 00:00:00 2001
From: jinbudaily <18336218010@163.com>
Date: Wed, 26 Jul 2023 16:21:21 +0800
Subject: [PATCH 13/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E7=BC=96=E8=BE=91?=
=?UTF-8?q?=E8=B7=9D=E7=A6=BB=E7=B3=BB=E5=88=97=20=E6=8E=92=E7=89=88?=
=?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...26\350\276\221\350\267\235\347\246\273.md" | 19 +++++++++++--------
...04\345\255\220\345\272\217\345\210\227.md" | 18 ++++++++++--------
...40\351\231\244\346\223\215\344\275\234.md" | 16 +++++++++-------
...11\346\255\245\351\223\272\345\236\253.md" | 8 ++------
4 files changed, 32 insertions(+), 29 deletions(-)
diff --git "a/problems/0072.\347\274\226\350\276\221\350\267\235\347\246\273.md" "b/problems/0072.\347\274\226\350\276\221\350\267\235\347\246\273.md"
index 703e891311..1ed9a86083 100644
--- "a/problems/0072.\347\274\226\350\276\221\350\267\235\347\246\273.md"
+++ "b/problems/0072.\347\274\226\350\276\221\350\267\235\347\246\273.md"
@@ -40,8 +40,8 @@ exection -> execution (插入 'u')
* 0 <= word1.length, word2.length <= 500
* word1 和 word2 由小写英文字母组成
-# 算法公开课
-**《代码随想录》算法视频公开课:[动态规划终极绝杀! LeetCode:72.编辑距离](https://www.bilibili.com/video/BV1we4y157wB/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+## 算法公开课
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[动态规划终极绝杀! LeetCode:72.编辑距离](https://www.bilibili.com/video/BV1we4y157wB/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
@@ -227,8 +227,8 @@ public:
## 其他语言版本
+### Java:
-Java:
```java
public int minDistance(String word1, String word2) {
int m = word1.length();
@@ -256,7 +256,8 @@ public int minDistance(String word1, String word2) {
}
```
-Python:
+### Python:
+
```python
class Solution:
def minDistance(self, word1: str, word2: str) -> int:
@@ -274,7 +275,8 @@ class Solution:
return dp[-1][-1]
```
-Go:
+### Go:
+
```Go
func minDistance(word1 string, word2 string) int {
m, n := len(word1), len(word2)
@@ -310,8 +312,8 @@ func Min(args ...int) int {
}
```
+### Javascript:
-Javascript:
```javascript
const minDistance = (word1, word2) => {
let dp = Array.from(Array(word1.length + 1), () => Array(word2.length+1).fill(0));
@@ -338,7 +340,7 @@ const minDistance = (word1, word2) => {
};
```
-TypeScript:
+### TypeScript:
```typescript
function minDistance(word1: string, word2: string): number {
@@ -373,7 +375,7 @@ function minDistance(word1: string, word2: string): number {
};
```
-C:
+### C:
```c
@@ -405,3 +407,4 @@ int minDistance(char * word1, char * word2){
+
diff --git "a/problems/0115.\344\270\215\345\220\214\347\232\204\345\255\220\345\272\217\345\210\227.md" "b/problems/0115.\344\270\215\345\220\214\347\232\204\345\255\220\345\272\217\345\210\227.md"
index 8c82880d58..d925c5dede 100644
--- "a/problems/0115.\344\270\215\345\220\214\347\232\204\345\255\220\345\272\217\345\210\227.md"
+++ "b/problems/0115.\344\270\215\345\220\214\347\232\204\345\255\220\345\272\217\345\210\227.md"
@@ -157,8 +157,8 @@ public:
## 其他语言版本
+### Java:
-Java:
```java
class Solution {
public int numDistinct(String s, String t) {
@@ -182,7 +182,8 @@ class Solution {
}
```
-Python:
+### Python:
+
```python
class Solution:
def numDistinct(self, s: str, t: str) -> int:
@@ -200,7 +201,8 @@ class Solution:
return dp[-1][-1]
```
-Python3:
+### Python3:
+
```python
class SolutionDP2:
"""
@@ -234,7 +236,8 @@ class SolutionDP2:
return dp[-1]
```
-Go:
+### Go:
+
```go
func numDistinct(s string, t string) int {
dp:= make([][]int,len(s)+1)
@@ -259,8 +262,8 @@ func numDistinct(s string, t string) int {
}
```
+### Javascript:
-Javascript:
```javascript
const numDistinct = (s, t) => {
let dp = Array.from(Array(s.length + 1), () => Array(t.length +1).fill(0));
@@ -283,7 +286,7 @@ const numDistinct = (s, t) => {
};
```
-TypeScript:
+### TypeScript:
```typescript
function numDistinct(s: string, t: string): number {
@@ -312,9 +315,8 @@ function numDistinct(s: string, t: string): number {
```
-
-
+
diff --git "a/problems/0583.\344\270\244\344\270\252\345\255\227\347\254\246\344\270\262\347\232\204\345\210\240\351\231\244\346\223\215\344\275\234.md" "b/problems/0583.\344\270\244\344\270\252\345\255\227\347\254\246\344\270\262\347\232\204\345\210\240\351\231\244\346\223\215\344\275\234.md"
index 48d15b0ba9..505a4e33ee 100644
--- "a/problems/0583.\344\270\244\344\270\252\345\255\227\347\254\246\344\270\262\347\232\204\345\210\240\351\231\244\346\223\215\344\275\234.md"
+++ "b/problems/0583.\344\270\244\344\270\252\345\255\227\347\254\246\344\270\262\347\232\204\345\210\240\351\231\244\346\223\215\344\275\234.md"
@@ -17,9 +17,9 @@
* 解释: 第一步将"sea"变为"ea",第二步将"eat"变为"ea"
-# 算法公开课
+## 算法公开课
-**《代码随想录》算法视频公开课:[动态规划之子序列,还是为了编辑距离做铺垫 | LeetCode:583.两个字符串的删除操(https://www.bilibili.com/video/BV1we4y157wB/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
+**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[LeetCode:583.两个字符串的删除操](https://www.bilibili.com/video/BV1we4y157wB/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
@@ -143,8 +143,8 @@ public:
## 其他语言版本
+### Java:
-Java:
```java
// dp数组中存储word1和word2最长相同子序列的长度
class Solution {
@@ -215,8 +215,8 @@ class Solution {
}
```
+### Python:
-Python:
```python
class Solution:
def minDistance(self, word1: str, word2: str) -> int:
@@ -234,7 +234,8 @@ class Solution:
return dp[-1][-1]
```
-Go:
+### Go:
+
```go
func minDistance(word1 string, word2 string) int {
dp := make([][]int, len(word1)+1)
@@ -267,7 +268,8 @@ func min(a, b int) int {
return b
}
```
-Javascript:
+### Javascript:
+
```javascript
// 方法一
var minDistance = (word1, word2) => {
@@ -309,7 +311,7 @@ var minDistance = function (word1, word2) {
};
```
-TypeScript:
+### TypeScript:
> dp版本一:
diff --git "a/problems/\344\270\272\344\272\206\347\273\235\346\235\200\347\274\226\350\276\221\350\267\235\347\246\273\357\274\214\345\215\241\345\260\224\345\201\232\344\272\206\344\270\211\346\255\245\351\223\272\345\236\253.md" "b/problems/\344\270\272\344\272\206\347\273\235\346\235\200\347\274\226\350\276\221\350\267\235\347\246\273\357\274\214\345\215\241\345\260\224\345\201\232\344\272\206\344\270\211\346\255\245\351\223\272\345\236\253.md"
index b8adffc775..50287ce20b 100644
--- "a/problems/\344\270\272\344\272\206\347\273\235\346\235\200\347\274\226\350\276\221\350\267\235\347\246\273\357\274\214\345\215\241\345\260\224\345\201\232\344\272\206\344\270\211\346\255\245\351\223\272\345\236\253.md"
+++ "b/problems/\344\270\272\344\272\206\347\273\235\346\235\200\347\274\226\350\276\221\350\267\235\347\246\273\357\274\214\345\215\241\345\260\224\345\201\232\344\272\206\344\270\211\346\255\245\351\223\272\345\236\253.md"
@@ -163,8 +163,8 @@ else {
## 其他语言版本
+### Java:
-Java:
```java
class Solution {
public int minDistance(String word1, String word2) {
@@ -193,11 +193,6 @@ class Solution {
}
```
-Python:
-
-
-Go:
-
@@ -205,3 +200,4 @@ Go:
+
From 4760924db0d9d5f53719ed36fe0b3d201cfb3c6f Mon Sep 17 00:00:00 2001
From: jinbudaily <18336218010@163.com>
Date: Wed, 26 Jul 2023 16:25:35 +0800
Subject: [PATCH 14/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=200516.=E6=9C=80?=
=?UTF-8?q?=E9=95=BF=E5=9B=9E=E6=96=87=E5=AD=90=E5=BA=8F=E5=88=97=200647.?=
=?UTF-8?q?=E5=9B=9E=E6=96=87=E5=AD=90=E4=B8=B2=20=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E8=A7=84=E5=88=92=E6=80=BB=E7=BB=93=20=E6=8E=92=E7=89=88?=
=?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...07\345\255\220\345\272\217\345\210\227.md" | 13 ++++++------
...36\346\226\207\345\255\220\344\270\262.md" | 21 ++++++++++++-------
...22\346\200\273\347\273\223\347\257\207.md" | 1 +
3 files changed, 20 insertions(+), 15 deletions(-)
diff --git "a/problems/0516.\346\234\200\351\225\277\345\233\236\346\226\207\345\255\220\345\272\217\345\210\227.md" "b/problems/0516.\346\234\200\351\225\277\345\233\236\346\226\207\345\255\220\345\272\217\345\210\227.md"
index fcdd57b0f4..8092758389 100644
--- "a/problems/0516.\346\234\200\351\225\277\345\233\236\346\226\207\345\255\220\345\272\217\345\210\227.md"
+++ "b/problems/0516.\346\234\200\351\225\277\345\233\236\346\226\207\345\255\220\345\272\217\345\210\227.md"
@@ -152,8 +152,7 @@ public:
## 其他语言版本
-
-Java:
+### Java:
```java
public class Solution {
@@ -175,8 +174,7 @@ public class Solution {
}
```
-
-Python:
+### Python:
```python
class Solution:
@@ -193,7 +191,7 @@ class Solution:
return dp[0][-1]
```
-Go:
+### Go:
```Go
func longestPalindromeSubseq(s string) int {
@@ -222,7 +220,7 @@ func longestPalindromeSubseq(s string) int {
}
```
-Javascript:
+### Javascript:
```javascript
const longestPalindromeSubseq = (s) => {
@@ -247,7 +245,7 @@ const longestPalindromeSubseq = (s) => {
};
```
-TypeScript:
+### TypeScript:
```typescript
function longestPalindromeSubseq(s: string): number {
@@ -281,3 +279,4 @@ function longestPalindromeSubseq(s: string): number {
+
diff --git "a/problems/0647.\345\233\236\346\226\207\345\255\220\344\270\262.md" "b/problems/0647.\345\233\236\346\226\207\345\255\220\344\270\262.md"
index 084b9f74e6..fdf83736a0 100644
--- "a/problems/0647.\345\233\236\346\226\207\345\255\220\344\270\262.md"
+++ "b/problems/0647.\345\233\236\346\226\207\345\255\220\344\270\262.md"
@@ -26,11 +26,13 @@
提示:输入的字符串长度不会超过 1000 。
-## 暴力解法
+## 思路
+
+### 暴力解法
两层for循环,遍历区间起始位置和终止位置,然后还需要一层遍历判断这个区间是不是回文。所以时间复杂度:O(n^3)
-## 动态规划
+### 动态规划
动规五部曲:
@@ -187,7 +189,7 @@ public:
* 时间复杂度:O(n^2)
* 空间复杂度:O(n^2)
-## 双指针法
+### 双指针法
动态规划的空间复杂度是偏高的,我们再看一下双指针法。
@@ -231,7 +233,7 @@ public:
## 其他语言版本
-Java:
+### Java:
动态规划:
@@ -337,7 +339,7 @@ class Solution {
}
```
-Python:
+### Python:
> 动态规划:
```python
@@ -390,7 +392,8 @@ class Solution:
return res
```
-Go:
+### Go:
+
```Go
func countSubstrings(s string) int {
res:=0
@@ -416,7 +419,8 @@ func countSubstrings(s string) int {
}
```
-Javascript
+### Javascript:
+
> 动态规划
```javascript
const countSubstrings = (s) => {
@@ -462,7 +466,7 @@ const countSubstrings = (s) => {
}
```
-TypeScript:
+### TypeScript:
> 动态规划:
@@ -524,3 +528,4 @@ function expandRange(s: string, left: number, right: number): number {
+
diff --git "a/problems/\345\212\250\346\200\201\350\247\204\345\210\222\346\200\273\347\273\223\347\257\207.md" "b/problems/\345\212\250\346\200\201\350\247\204\345\210\222\346\200\273\347\273\223\347\257\207.md"
index 8a1531f8be..c86376d349 100644
--- "a/problems/\345\212\250\346\200\201\350\247\204\345\210\222\346\200\273\347\273\223\347\257\207.md"
+++ "b/problems/\345\212\250\346\200\201\350\247\204\345\210\222\346\200\273\347\273\223\347\257\207.md"
@@ -136,3 +136,4 @@
+