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

[pull] master from youngyangyang04:master #317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
pull merged 16 commits into AlgorithmAndLeetCode:master from youngyangyang04:master
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
6ed304e
更新 动态规划理论基础 排版格式修复
jinbudaily Jul 26, 2023
b295b12
更新 0509.斐波那契数 排版格式修复
jinbudaily Jul 26, 2023
9b24f3c
更新 0070.爬楼梯 排版格式修复
jinbudaily Jul 26, 2023
86f794b
更新 0746.使用最小花费爬楼梯 排版格式修复
jinbudaily Jul 26, 2023
0e3500e
更新 动态规划 周末总结 排版格式修复
jinbudaily Jul 26, 2023
126aaac
更新 背包理论基础 排版格式修复
jinbudaily Jul 26, 2023
fc19feb
更新 0416.分割等和自己 0474.一和零 0494.目标和 1049.最后一块石头的重量II 排版格式修复
jinbudaily Jul 26, 2023
7ac2179
更新 完全背包理论基础 0139.单词拆分 0279.完全平方数 0322.零钱兑换 0377.组合总和IV 0518.零钱兑换II 多重...
jinbudaily Jul 26, 2023
89571ea
更新 0198.打家劫舍 0213.打家劫舍II 0337.打家劫舍III 排版格式修复
jinbudaily Jul 26, 2023
6b32268
更新 买卖股票的最佳时机系列 排版格式修复
jinbudaily Jul 26, 2023
038d509
更新 0674.最长连续递增序列 排版格式修复
jinbudaily Jul 26, 2023
9b0c0f2
更新 0392.判断子序列 0718.最长重复子数组 1035.不相交的线 1143.最长公共子序列 排版格式修复
jinbudaily Jul 26, 2023
a0edc60
更新 编辑距离系列 排版格式修复
jinbudaily Jul 26, 2023
4760924
更新 0516.最长回文子序列 0647.回文子串 动态规划总结 排版格式修复
jinbudaily Jul 26, 2023
04dd0ec
Merge branch 'master' of github.com:jinbudaily/leetcode-master
jinbudaily Jul 26, 2023
2691e27
Merge pull request #2208 from jinbudaily/master
youngyangyang04 Jul 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
更新 0516.最长回文子序列 0647.回文子串 动态规划总结 排版格式修复
  • Loading branch information
jinbudaily committed Jul 26, 2023
commit 4760924db0d9d5f53719ed36fe0b3d201cfb3c6f
13 changes: 6 additions & 7 deletions problems/0516.最长回文子序列.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ public:

## 其他语言版本


Java:
### Java:

```java
public class Solution {
Expand All @@ -175,8 +174,7 @@ public class Solution {
}
```


Python:
### Python:

```python
class Solution:
Expand All @@ -193,7 +191,7 @@ class Solution:
return dp[0][-1]
```

Go:
### Go:

```Go
func longestPalindromeSubseq(s string) int {
Expand Down Expand Up @@ -222,7 +220,7 @@ func longestPalindromeSubseq(s string) int {
}
```

Javascript:
### Javascript:

```javascript
const longestPalindromeSubseq = (s) => {
Expand All @@ -247,7 +245,7 @@ const longestPalindromeSubseq = (s) => {
};
```

TypeScript:
### TypeScript:

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

21 changes: 13 additions & 8 deletions problems/0647.回文子串.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@

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

## 暴力解法
## 思路

### 暴力解法

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

## 动态规划
### 动态规划

动规五部曲:

Expand Down Expand Up @@ -187,7 +189,7 @@ public:
* 时间复杂度:O(n^2)
* 空间复杂度:O(n^2)

## 双指针法
### 双指针法

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

Expand Down Expand Up @@ -231,7 +233,7 @@ public:

## 其他语言版本

Java:
### Java:

动态规划:

Expand Down Expand Up @@ -337,7 +339,7 @@ class Solution {
}
```

Python:
### Python:

> 动态规划:
```python
Expand Down Expand Up @@ -390,7 +392,8 @@ class Solution:
return res
```

Go:
### Go:

```Go
func countSubstrings(s string) int {
res:=0
Expand All @@ -416,7 +419,8 @@ func countSubstrings(s string) int {
}
```

Javascript
### Javascript:

> 动态规划
```javascript
const countSubstrings = (s) => {
Expand Down Expand Up @@ -462,7 +466,7 @@ const countSubstrings = (s) => {
}
```

TypeScript:
### TypeScript:

> 动态规划:

Expand Down Expand Up @@ -524,3 +528,4 @@ function expandRange(s: string, left: number, right: number): number {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

1 change: 1 addition & 0 deletions problems/动态规划总结篇.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,4 @@
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

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