参与本项目,贡献其他语言版本的代码,拥抱开源,让更多学习算法的小伙伴们收益!
- # 动态规划:01背包理论基础(滚动数组) -**《代码随想录》算法视频公开课:[带你学透0-1背包问题!(滚动数组)](https://www.bilibili.com/video/BV1BU4y177kY/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。 +## 算法公开课 + +**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[带你学透0-1背包问题!(滚动数组)](https://www.bilibili.com/video/BV1BU4y177kY/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。 + +## 思路 昨天[动态规划:关于01背包问题,你该了解这些!](https://programmercarl.com/背包理论基础01背包-1.html)中是用二维dp数组来讲解01背包。 @@ -29,7 +32,7 @@ 问背包能背的物品最大价值是多少? -## 一维dp数组(滚动数组) +### 一维dp数组(滚动数组) 对于背包问题其实状态都是可以压缩的。 @@ -154,8 +157,6 @@ dp[1] = dp[1 - weight[0]] + value[0] = 15 -## 一维dp01背包完整C++测试代码 - ```CPP void test_1_wei_bag_problem() { vector
+
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 12/16] =?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
---
problems/0300.最长上升子序列.md | 24 +++++++++++------------
problems/0674.最长连续递增序列.md | 18 +++++++++--------
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/problems/0300.最长上升子序列.md b/problems/0300.最长上升子序列.md
index c58c3bf6..11cf13d9 100644
--- a/problems/0300.最长上升子序列.md
+++ b/problems/0300.最长上升子序列.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
+
diff --git a/problems/0674.最长连续递增序列.md b/problems/0674.最长连续递增序列.md
index 8cc270ec..0c5e64b3 100644
--- a/problems/0674.最长连续递增序列.md
+++ b/problems/0674.最长连续递增序列.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
+
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 13/16] =?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
---
problems/0392.判断子序列.md | 16 +++++++++-------
problems/0718.最长重复子数组.md | 18 +++++++++---------
problems/1035.不相交的线.md | 17 +++++++++--------
problems/1143.最长公共子序列.md | 19 ++++++++++++-------
4 files changed, 39 insertions(+), 31 deletions(-)
diff --git a/problems/0392.判断子序列.md b/problems/0392.判断子序列.md
index c10114c0..6342a41f 100644
--- a/problems/0392.判断子序列.md
+++ b/problems/0392.判断子序列.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.最长重复子数组.md b/problems/0718.最长重复子数组.md
index 82bf4f59..18cc0240 100644
--- a/problems/0718.最长重复子数组.md
+++ b/problems/0718.最长重复子数组.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.不相交的线.md b/problems/1035.不相交的线.md
index 7142d75c..74e94c84 100644
--- a/problems/1035.不相交的线.md
+++ b/problems/1035.不相交的线.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
+
diff --git a/problems/1143.最长公共子序列.md b/problems/1143.最长公共子序列.md
index 68269b87..260b085e 100644
--- a/problems/1143.最长公共子序列.md
+++ b/problems/1143.最长公共子序列.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 14/16] =?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
---
problems/0072.编辑距离.md | 19 +++++++++++--------
problems/0115.不同的子序列.md | 18 ++++++++++--------
.../0583.两个字符串的删除操作.md | 16 +++++++++-------
...编辑距离,卡尔做了三步铺垫.md | 8 ++------
4 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/problems/0072.编辑距离.md b/problems/0072.编辑距离.md
index 703e8913..1ed9a860 100644
--- a/problems/0072.编辑距离.md
+++ b/problems/0072.编辑距离.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.不同的子序列.md b/problems/0115.不同的子序列.md
index 8c82880d..d925c5de 100644
--- a/problems/0115.不同的子序列.md
+++ b/problems/0115.不同的子序列.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.两个字符串的删除操作.md b/problems/0583.两个字符串的删除操作.md
index 48d15b0b..505a4e33 100644
--- a/problems/0583.两个字符串的删除操作.md
+++ b/problems/0583.两个字符串的删除操作.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/为了绝杀编辑距离,卡尔做了三步铺垫.md b/problems/为了绝杀编辑距离,卡尔做了三步铺垫.md
index b8adffc7..50287ce2 100644
--- a/problems/为了绝杀编辑距离,卡尔做了三步铺垫.md
+++ b/problems/为了绝杀编辑距离,卡尔做了三步铺垫.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 15/16] =?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
---
problems/0516.最长回文子序列.md | 13 ++++++-------
problems/0647.回文子串.md | 21 +++++++++++++--------
problems/动态规划总结篇.md | 1 +
3 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/problems/0516.最长回文子序列.md b/problems/0516.最长回文子序列.md
index fcdd57b0..80927583 100644
--- a/problems/0516.最长回文子序列.md
+++ b/problems/0516.最长回文子序列.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.回文子串.md b/problems/0647.回文子串.md
index 084b9f74..fdf83736 100644
--- a/problems/0647.回文子串.md
+++ b/problems/0647.回文子串.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/动态规划总结篇.md b/problems/动态规划总结篇.md
index 8a1531f8..c86376d3 100644
--- a/problems/动态规划总结篇.md
+++ b/problems/动态规划总结篇.md
@@ -136,3 +136,4 @@
+
From 9693ad4e456bf583b96e1f8a5cb965ee0f6b4f63 Mon Sep 17 00:00:00 2001
From: programmercarl <826123027@qq.com>
Date: Thu, 27 Jul 2023 15:40:30 +0800
Subject: [PATCH 16/16] Update
---
README.md | 25 +-
problems/qita/join.md | 249 ++++++++++++++++++
problems/qita/参与本项目.md | 15 --
.../前序/ACM模式如何构建二叉树.md | 2 +
...代码模式,什么又是ACM模式?.md | 4 +
problems/前序/代码风格.md | 2 +-
6 files changed, 263 insertions(+), 34 deletions(-)
create mode 100644 problems/qita/join.md
delete mode 100644 problems/qita/参与本项目.md
diff --git a/README.md b/README.md
index dd70d8cb..e5eb97bc 100644
--- a/README.md
+++ b/README.md
@@ -5,11 +5,11 @@
> 1. **介绍** :本项目是一套完整的刷题计划,旨在帮助大家少走弯路,循序渐进学算法,[关注作者](#关于作者)
> 2. **正式出版** :[《代码随想录》](https://programmercarl.com/other/publish.html) 。
> 3. **PDF版本** :[「代码随想录」算法精讲 PDF 版本](https://programmercarl.com/other/algo_pdf.html) 。
-> 4. **算法公开课** :[《代码随想录》算法视频公开课](https://www.bilibili.com/video/BV1fA4y1o715) 。
+> 4. **算法公开课** :[《代码随想录》算法视频公开课](https://www.programmercarl.com/other/gongkaike.html) 。
> 5. **最强八股文** :[代码随想录知识星球精华PDF](https://www.programmercarl.com/other/kstar_baguwen.html) 。
> 6. **刷题顺序** :README已经将刷题顺序排好了,按照顺序一道一道刷就可以。
> 7. **学习社区** :一起学习打卡/面试技巧/如何选择offer/大厂内推/职场规则/简历修改/技术分享/程序人生。欢迎加入[「代码随想录」知识星球](https://programmercarl.com/other/kstar.html) 。
-> 8. **提交代码** :本项目统一使用C++语言进行讲解,但已经有Java、Python、Go、JavaScript等等多语言版本,感谢[这里的每一位贡献者](https://github.com/youngyangyang04/leetcode-master/graphs/contributors),如果你也想贡献代码点亮你的头像,[点击这里](https://mp.weixin.qq.com/s/tqCxrMEU-ajQumL1i8im9A)了解提交代码的方式。
+> 8. **提交代码** :本项目统一使用C++语言进行讲解,但已经有Java、Python、Go、JavaScript等等多语言版本,感谢[这里的每一位贡献者](https://github.com/youngyangyang04/leetcode-master/graphs/contributors),如果你也想贡献代码点亮你的头像,[点击这里](https://www.programmercarl.com/qita/join.html)了解提交代码的方式。
> 9. **转载须知** :以下所有文章皆为我([程序员Carl](https://github.com/youngyangyang04))的原创。引用本项目文章请注明出处,发现恶意抄袭或搬运,会动用法律武器维护自己的权益。让我们一起维护一个良好的技术创作环境!
@@ -51,19 +51,12 @@
## 如何使用该刷题攻略
-电脑端还看不到留言,大家可以在公众号[「代码随想录」](https://img-blog.csdnimg.cn/20201124161234338.png),左下角有「刷题攻略」,这是手机版刷题攻略,看完就会发现有很多录友(代码随想录的朋友们)在文章下留言打卡,这份刷题顺序和题解已经陪伴了上万录友了,同时也说明文章的质量是经过上万人的考验!
-
-欢迎每一位学习算法的小伙伴加入到这个学习阵营来!
-
-**目前已经更新了,数组-> 链表-> 哈希表->字符串->栈与队列->树->回溯->贪心,八个专题了,正在讲解动态规划!**
+按照先面的排列顺序,从数组开始刷起就可以了,顺序都安排好了,按顺序刷就好。
在刷题攻略中,每个专题开始都有理论基础篇,并不像是教科书般的理论介绍,而是从实战中归纳需要的基础知识。每个专题结束都有总结篇,最这个专题的归纳总结。
如果你是算法老手,这篇攻略也是复习的最佳资料,如果把每个系列对应的总结篇,快速过一遍,整个算法知识体系以及各种解法就重现脑海了。
-
-目前「代码随想录」刷题攻略更新了:**200多篇文章,精讲了200道经典算法题目,共60w字的详细图解,大部分题目都搭配了20分钟左右的视频讲解**,视频质量很好,口碑很好,大家可以去看看,视频列表:[代码随想录视频讲解](https://www.bilibili.com/video/BV1fA4y1o715)。
-
**这里每一篇题解,都是精品,值得仔细琢磨**。
我在题目讲解中统一使用C++,但你会发现下面几乎每篇题解都配有其他语言版本,Java、Python、Go、JavaScript等等,正是这些[热心小伙们](https://github.com/youngyangyang04/leetcode-master/graphs/contributors)贡献的代码,当然我也会严格把控代码质量。
@@ -100,14 +93,11 @@
* [程序员应该用什么用具来写文档?](./problems/前序/程序员写文档工具.md)
* 求职
+ * [ACM模式练习网站,卡码网](https://kamacoder.com/)
* [程序员的简历应该这么写!!(附简历模板)](./problems/前序/程序员简历.md)
+ * [【专业技能】应该这样写!](https://programmercarl.com/other/jianlizhuanye.html)
+ * [【项目经历】应该这样写!](https://programmercarl.com/other/jianlixiangmu.html)
* [BAT级别技术面试流程和注意事项都在这里了](./problems/前序/BAT级别技术面试流程和注意事项都在这里了.md)
- * [北京有这些互联网公司,你都知道么?](./problems/前序/北京互联网公司总结.md)
- * [上海有这些互联网公司,你都知道么?](./problems/前序/上海互联网公司总结.md)
- * [深圳有这些互联网公司,你都知道么?](./problems/前序/深圳互联网公司总结.md)
- * [广州有这些互联网公司,你都知道么?](./problems/前序/广州互联网公司总结.md)
- * [成都有这些互联网公司,你都知道么?](./problems/前序/成都互联网公司总结.md)
- * [杭州有这些互联网公司,你都知道么?](./problems/前序/杭州互联网公司总结.md)
* 算法性能分析
* [关于时间复杂度,你不知道的都在这里!](./problems/前序/关于时间复杂度,你不知道的都在这里!.md)
@@ -506,7 +496,7 @@
# 关于作者
-大家好,我是程序员Carl,哈工大师兄,《代码随想录》作者,先后在腾讯和百度从事后端技术研发,CSDN博客专家。对算法和C++后端技术有一定的见解,利用工作之余重新刷leetcode。
+大家好,我是程序员Carl,哈工大师兄,《代码随想录》作者,先后在腾讯和百度从事后端技术研发。对算法和C++后端技术有一定的见解,利用工作之余重新刷leetcode。
加入「代码随想录」刷题小分队(微信群),可以扫下方二维码,加代码随想录客服微信。
@@ -527,4 +517,3 @@