未验证 提交 dff898bc 编写于 作者: K Keqi Huang 提交者: GitHub

Update 0132._Palindrome_Partitioning_II.md

上级 8b0c27a5
......@@ -82,6 +82,8 @@ class Solution:
- 将s[i]作为palindrome的中间靠前的那个字符(even length),向左边扩展j-1个字符,向右边扩展j个字符,使得s[i-j+1:i+j+1]是palindrome,同时保证不越界,
此时cut[i+j+1] = min(cut[i+j+1], cut[i-j+1] + 1)
- 最后返回cut[-1]
参考[My solution does not need a table for palindrome, is it right ? It uses only O(n) space.](https://leetcode.com/problems/palindrome-partitioning-ii/discuss/42198/My-solution-does-not-need-a-table-for-palindrome-is-it-right-It-uses-only-O(n)-space.)
```python
class Solution:
def minCut(self, s: str) -> int:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册