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 3e4eda7

Browse files
Add the corresponding link to LeetCode 131
1 parent 75207ee commit 3e4eda7

File tree

1 file changed

+2
-0
lines changed
  • Dynamic_Programming/131.Palindrome-Partitioning

1 file changed

+2
-0
lines changed

‎Dynamic_Programming/131.Palindrome-Partitioning/Readme.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
然后从第一个字符开始进行深度优先搜索。设计dfs(i,temp),表示考虑以当前的位置i为substring的开头,遍历有哪些位置j满足[i:j]的字符串满足回文(即dp[i][j]=1),就将该字符串收录进temp,然后递归搜索第j+1个位置。如果dfs的参数i走到了n,说明恰好将整个s分割成了若干段回文串,就将这组分割的子串temp加入最终答案。
66

77
特别注意,这个dfs在回溯的时候需要将temp末尾加入的子串弹出。
8+
9+
[Leetcode Link](https://leetcode.com/problems/palindrome-partitioning/)

0 commit comments

Comments
(0)

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