更新 0392.判断子序列 0718.最长重复子数组 1035.不相交的线 1143.最长公共子序列 排版格式修复
This commit is contained in:
@@ -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 {
|
||||
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
|
||||
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
|
||||
</a>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user