给定一个字符串s,分割s使得s的每一个子串都是回文串返回所有的回文分割结果例如:给定字符串s=“aab”,返回[↵ [“aa”,“b”],↵ [“a”,“a”,“b”]↵ ]
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”]↵ ]

19、 palindrome-partitioning

思路:使用分治法递归地把字符串分割为两部分,并进行是否为回文的判断,可使用动态规划的思想存储为回文的子串提升效率。

相关文章:

  • 2021-12-19
  • 2021-07-04
  • 2021-09-09
  • 2022-01-01
  • 2021-06-07
  • 2021-11-09
  • 2021-10-23
猜你喜欢
  • 2022-01-24
  • 2021-08-04
  • 2021-08-01
  • 2021-10-31
相关资源
相似解决方案