47~541连接更新‘
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
## 131.分割回文串
|
||||
|
||||
题目链接:https://leetcode-cn.com/problems/palindrome-partitioning/
|
||||
[力扣题目链接](https://leetcode-cn.com/problems/palindrome-partitioning/)
|
||||
|
||||
给定一个字符串 s,将 s 分割成一些子串,使每个子串都是回文串。
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
本题递归函数参数还需要startIndex,因为切割过的地方,不能重复切割,和组合问题也是保持一致的。
|
||||
|
||||
在[回溯算法:求组合总和(二)](https://mp.weixin.qq.com/s/FLg8G6EjVcxBjwCbzpACPw)中我们深入探讨了组合问题什么时候需要startIndex,什么时候不需要startIndex。
|
||||
在[回溯算法:求组合总和(二)](https://programmercarl.com/0039.组合总和.html)中我们深入探讨了组合问题什么时候需要startIndex,什么时候不需要startIndex。
|
||||
|
||||
代码如下:
|
||||
|
||||
@@ -143,7 +143,7 @@ for (int i = startIndex; i < s.size(); i++) {
|
||||
}
|
||||
```
|
||||
|
||||
如果大家对双指针法有生疏了,传送门:[双指针法:总结篇!](https://mp.weixin.qq.com/s/_p7grwjISfMh0U65uOyCjA)
|
||||
如果大家对双指针法有生疏了,传送门:[双指针法:总结篇!](https://programmercarl.com/双指针总结.html)
|
||||
|
||||
此时关键代码已经讲解完毕,整体代码如下(详细注释了)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user