leecode---Palindrome Partitioning
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来做,但是可能因为自己水平不够,不明白如何算是dfs。
理解的方法是:从第一个字符开始,找回文;然后到第k个时,找这k个里面的回文。但是,如何保证没有重复的呢?以及,如何将这些元素显示呢?不明白。
下面是一些链接的解法:
http://blog.sina.com.cn/s/blog_6db2004e01017stm.html
http://www.cppblog.com/wicbnu/archive/2013/03/18/198562.aspx
http://blog.csdn.net/sunjilong/article/details/8667929
有链接竟然还不懂,好弱啊。。。。

浙公网安备 33010602011771号