diff --git a/problems/0131.分割回文串.md b/problems/0131.分割回文串.md index 636cf59c..92fed58a 100644 --- a/problems/0131.分割回文串.md +++ b/problems/0131.分割回文串.md @@ -118,7 +118,7 @@ for (int i = startIndex; i < s.size(); i++) { continue; } backtracking(s, i + 1); // 寻找i+1为起始位置的子串 - path.pop_back(); // 回溯过程,弹出本次已经填在的子串 + path.pop_back(); // 回溯过程,弹出本次已经添加的子串 } ``` @@ -189,7 +189,7 @@ private: continue; } backtracking(s, i + 1); // 寻找i+1为起始位置的子串 - path.pop_back(); // 回溯过程,弹出本次已经填在的子串 + path.pop_back(); // 回溯过程,弹出本次已经添加的子串 } } bool isPalindrome(const string& s, int start, int end) { @@ -245,7 +245,7 @@ private: continue; } backtracking(s, i + 1); // 寻找i+1为起始位置的子串 - path.pop_back(); // 回溯过程,弹出本次已经填在的子串 + path.pop_back(); // 回溯过程,弹出本次已经添加的子串 } } void computePalindrome(const string& s) { @@ -437,7 +437,7 @@ class Solution: substring = s[startIndex:i + 1] path.append(substring) self.backtracking(s, i + 1, path, result, isPalindrome) # 寻找i+1为起始位置的子串 - path.pop() # 回溯过程,弹出本次已经填在的子串 + path.pop() # 回溯过程,弹出本次已经添加的子串 def computePalindrome(self, s, isPalindrome): for i in range(len(s) - 1, -1, -1): # 需要倒序计算,保证在i行时,i+1行已经计算好了 @@ -497,7 +497,7 @@ func dfs(s string, start int) { if isPalindrome(str) { // 是回文子串 path = append(path, str) dfs(s, i+1) // 寻找i+1为起始位置的子串 - path = path[:len(path)-1] // 回溯过程,弹出本次已经填在的子串 + path = path[:len(path)-1] // 回溯过程,弹出本次已经添加的子串 } } }