更新 0392.判断子序列 0718.最长重复子数组 1035.不相交的线 1143.最长公共子序列 排版格式修复

This commit is contained in:
jinbudaily
2023-07-26 16:07:52 +08:00
parent 038d50957c
commit 9b0c0f20dc
4 changed files with 39 additions and 31 deletions

View File

@@ -25,9 +25,7 @@
## 算法公开课
**代码随想录算法视频公开课[动态规划之子序列问题想清楚DP数组的定义 | LeetCode718.最长重复子数组](https://www.bilibili.com/video/BV178411H7hV)相信结合视频再看本篇题解更有助于大家对本题的理解**。
**[代码随想录算法视频公开课](https://programmercarl.com/other/gongkaike.html)[动态规划之子序列问题想清楚DP数组的定义 | LeetCode718.最长重复子数组](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 {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>