Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4760924

Browse files
更新 0516.最长回文子序列 0647.回文子串 动态规划总结 排版格式修复
1 parent a0edc60 commit 4760924

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

‎problems/0516.最长回文子序列.md‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ public:
152152
153153
## 其他语言版本
154154
155-
156-
Java:
155+
### Java:
157156
158157
```java
159158
public class Solution {
@@ -175,8 +174,7 @@ public class Solution {
175174
}
176175
```
177176

178-
179-
Python:
177+
### Python:
180178

181179
```python
182180
class Solution:
@@ -193,7 +191,7 @@ class Solution:
193191
return dp[0][-1]
194192
```
195193

196-
Go:
194+
### Go:
197195

198196
```Go
199197
func longestPalindromeSubseq(s string) int {
@@ -222,7 +220,7 @@ func longestPalindromeSubseq(s string) int {
222220
}
223221
```
224222

225-
Javascript:
223+
### Javascript:
226224

227225
```javascript
228226
const longestPalindromeSubseq = (s) => {
@@ -247,7 +245,7 @@ const longestPalindromeSubseq = (s) => {
247245
};
248246
```
249247

250-
TypeScript:
248+
### TypeScript:
251249

252250
```typescript
253251
function longestPalindromeSubseq(s: string): number {
@@ -281,3 +279,4 @@ function longestPalindromeSubseq(s: string): number {
281279
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
282280
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
283281
</a>
282+

‎problems/0647.回文子串.md‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@
2626

2727
提示:输入的字符串长度不会超过 1000 。
2828

29-
## 暴力解法
29+
## 思路
30+
31+
### 暴力解法
3032

3133
两层for循环,遍历区间起始位置和终止位置,然后还需要一层遍历判断这个区间是不是回文。所以时间复杂度:O(n^3)
3234

33-
## 动态规划
35+
### 动态规划
3436

3537
动规五部曲:
3638

@@ -187,7 +189,7 @@ public:
187189
* 时间复杂度:O(n^2)
188190
* 空间复杂度:O(n^2)
189191

190-
## 双指针法
192+
### 双指针法
191193

192194
动态规划的空间复杂度是偏高的,我们再看一下双指针法。
193195

@@ -231,7 +233,7 @@ public:
231233
232234
## 其他语言版本
233235
234-
Java:
236+
### Java:
235237
236238
动态规划:
237239
@@ -337,7 +339,7 @@ class Solution {
337339
}
338340
```
339341

340-
Python:
342+
### Python:
341343

342344
> 动态规划:
343345
```python
@@ -390,7 +392,8 @@ class Solution:
390392
return res
391393
```
392394
393-
Go:
395+
### Go:
396+
394397
```Go
395398
func countSubstrings(s string) int {
396399
res:=0
@@ -416,7 +419,8 @@ func countSubstrings(s string) int {
416419
}
417420
```
418421

419-
Javascript
422+
### Javascript:
423+
420424
> 动态规划
421425
```javascript
422426
const countSubstrings = (s) => {
@@ -462,7 +466,7 @@ const countSubstrings = (s) => {
462466
}
463467
```
464468

465-
TypeScript:
469+
### TypeScript:
466470

467471
> 动态规划:
468472
@@ -524,3 +528,4 @@ function expandRange(s: string, left: number, right: number): number {
524528
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
525529
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
526530
</a>
531+

‎problems/动态规划总结篇.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,4 @@
136136
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
137137
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
138138
</a>
139+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /