Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion problems/0027.移除元素.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,4 +444,3 @@ public class Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

11 changes: 6 additions & 5 deletions problems/0028.实现strStr.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
当 needle 是空字符串时,我们应当返回什么值呢?这是一个在面试中很好的问题。
对于本题而言,当 needle 是空字符串时我们应当返回 0 。这与C语言的 strstr() 以及 Java的 indexOf() 定义相符。

## 算法公开课

## 思路

本题是KMP 经典题目。

以下文字如果看不进去,可以看我的B站视频:
本题是KMP 经典题目。以下文字如果看不进去,可以看[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html),相信结合视频再看本篇题解,更有助于大家对本题的理解。

* [帮你把KMP算法学个通透!B站(理论篇)](https://www.bilibili.com/video/BV1PD4y1o7nd/)
* [帮你把KMP算法学个通透!(求next数组代码篇)](https://www.bilibili.com/video/BV1M5411j7Xx)


## 思路

KMP的经典思想就是:**当出现字符串不匹配时,可以记录一部分之前已经匹配的文本内容,利用这些信息避免从头再去做匹配。**

本篇将以如下顺序来讲解KMP,
Expand Down Expand Up @@ -1362,3 +1362,4 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

5 changes: 4 additions & 1 deletion problems/0042.接雨水.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
* 输入:height = [4,2,0,3,2,5]
* 输出:9

## 算法公开课

**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[单调栈,经典来袭!LeetCode:42.接雨水](https://www.bilibili.com/video/BV1uD4y1u75P/),相信结合视频在看本篇题解,更有助于大家对本题的理解**。


## 思路

Expand Down Expand Up @@ -1029,4 +1033,3 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

1 change: 0 additions & 1 deletion problems/0045.跳跃游戏II.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,4 +469,3 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

1 change: 0 additions & 1 deletion problems/0059.螺旋矩阵II.md
Original file line number Diff line number Diff line change
Expand Up @@ -744,4 +744,3 @@ end
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

1 change: 1 addition & 0 deletions problems/0062.不同路径.md
Original file line number Diff line number Diff line change
Expand Up @@ -559,3 +559,4 @@ public class Solution
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

1 change: 1 addition & 0 deletions problems/0063.不同路径II.md
Original file line number Diff line number Diff line change
Expand Up @@ -739,3 +739,4 @@ object Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

4 changes: 4 additions & 0 deletions problems/0084.柱状图中最大的矩形.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
* 1 <= heights.length <=10^5
* 0 <= heights[i] <= 10^4

## 算法公开课

**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[单调栈,又一次经典来袭! LeetCode:84.柱状图中最大的矩形](https://www.bilibili.com/video/BV1Ns4y1o7uB/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。

## 思路

本题和[42. 接雨水](https://programmercarl.com/0042.接雨水.html),是遥相呼应的两道题目,建议都要仔细做一做,原理上有很多相同的地方,但细节上又有差异,更可以加深对单调栈的理解!
Expand Down
3 changes: 3 additions & 0 deletions problems/0115.不同的子序列.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
* 0 <= s.length, t.length <= 1000
* s 和 t 由英文字母组成

## 算法公开课

**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[动态规划之子序列,为了编辑距离做铺垫 | LeetCode:115.不同的子序列](https://www.bilibili.com/video/BV1fG4y1m75Q/),相信结合视频在看本篇题解,更有助于大家对本题的理解**。

## 思路

Expand Down
1 change: 0 additions & 1 deletion problems/0209.长度最小的子数组.md
Original file line number Diff line number Diff line change
Expand Up @@ -563,4 +563,3 @@ public class Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

2 changes: 2 additions & 0 deletions problems/0416.分割等和子集.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
</a>
<p align="center"><strong><a href="https://mp.weixin.qq.com/s/tqCxrMEU-ajQumL1i8im9A">参与本项目</a>,贡献其他语言版本的代码,拥抱开源,让更多学习算法的小伙伴们收益!</strong></p>


# 416. 分割等和子集

[力扣题目链接](https://leetcode.cn/problems/partition-equal-subset-sum/)
Expand Down Expand Up @@ -730,3 +731,4 @@ object Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

4 changes: 4 additions & 0 deletions problems/0496.下一个更大元素I.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ nums1 中数字 x 的下一个更大元素是指 x 在 nums2 中对应位
* nums1和nums2中所有整数 互不相同
* nums1 中的所有整数同样出现在 nums2 中

## 算法公开课

**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[单调栈,套上一个壳子就有点绕了| LeetCode:496.下一个更大元素](https://www.bilibili.com/video/BV1jA411m7dX/),相信结合视频在看本篇题解,更有助于大家对本题的理解**。

## 思路

做本题之前,建议先做一下[739. 每日温度](https://programmercarl.com/0739.每日温度.html)
Expand Down
5 changes: 5 additions & 0 deletions problems/0503.下一个更大元素II.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
* 1 <= nums.length <= 10^4
* -10^9 <= nums[i] <= 10^9

## 算法公开课

**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[单调栈,成环了可怎么办?LeetCode:503.下一个更大元素II](https://www.bilibili.com/video/BV15y4y1o7Dw/),相信结合视频在看本篇题解,更有助于大家对本题的理解**。


## 思路

Expand Down Expand Up @@ -294,3 +298,4 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

4 changes: 4 additions & 0 deletions problems/0516.最长回文子序列.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
* 1 <= s.length <= 1000
* s 只包含小写英文字母

## 算法公开课

**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[动态规划再显神通,LeetCode:516.最长回文子序列](https://www.bilibili.com/video/BV1d8411K7W6/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。


## 思路

Expand Down
5 changes: 4 additions & 1 deletion problems/0647.回文子串.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@

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

## 算法公开课

**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[动态规划,字符串性质决定了DP数组的定义 | LeetCode:647.回文子串](https://www.bilibili.com/video/BV17G4y1y7z9/),相信结合视频在看本篇题解,更有助于大家对本题的理解**。

## 思路

### 暴力解法
Expand Down Expand Up @@ -571,4 +575,3 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

1 change: 0 additions & 1 deletion problems/0701.二叉搜索树中的插入操作.md
Original file line number Diff line number Diff line change
Expand Up @@ -697,4 +697,3 @@ impl Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

4 changes: 4 additions & 0 deletions problems/0739.每日温度.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

提示:气温 列表长度的范围是 [1, 30000]。每个气温的值的均为华氏度,都是在 [30, 100] 范围内的整数。

## 算法公开课

**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[单调栈,你该了解的,这里都讲了!LeetCode:739.每日温度](https://www.bilibili.com/video/BV1my4y1Z7jj/),相信结合视频在看本篇题解,更有助于大家对本题的理解**。


## 思路

Expand Down
1 change: 0 additions & 1 deletion problems/二叉树总结篇.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,3 @@
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

1 change: 0 additions & 1 deletion problems/字符串总结.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,3 @@ KMP算法是字符串查找最重要的算法,但彻底理解KMP并不容易
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

3 changes: 3 additions & 0 deletions problems/贪心算法理论基础.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

<img src='https://code-thinking-1253855093.file.myqcloud.com/pics/20210917104315.png' width=600 alt='贪心算法大纲'> </img></div>

## 算法公开课

**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[贪心算法理论基础!](https://www.bilibili.com/video/BV1WK4y1R71x/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。

## 什么是贪心

Expand Down
1 change: 0 additions & 1 deletion problems/面试题02.07.链表相交.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,4 +508,3 @@ object Solution {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>