r**u 发帖数: 1567 | 1 Given a string s, partition s such that every substring of the partition is
a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
[
["aa","b"],
["a","a","b"]
]
DFS就是要枚举所有可能的划分,然后检查是否是palindrome吧,中间如果发现划分不
满足palindrome了,就backtrack。这个复杂度应该怎么求? | e****d 发帖数: 333 | | r**u 发帖数: 1567 | 3 怎么算的?
【在 e****d 的大作中提到】 : O(n^3)
|
|