136.Palindrome Partitioning
1.Description(Medium)
Given a strings, partition_s_such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
Example
Given s ="aab"
, return:
2.Code
遇到要求所有组合、可能、排列等解集的题目,一般都是用DFS + backtracking来做。这种需要输出所有结果的基本上都是DFS的解法
https://soulmachine.gitbooks.io/algorithm-essentials/content/java/dfs/palindrome-partitioning.html
Palindrome Partition II is Dynamic Programming
Last updated