20、 palindrome-partitioning-ii
给出一个字符串s,分割s使得分割出的每一个子串都是回文串
计算将字符串s分割成回文分割结果的最小切割数
例如:给定字符串s=“aab”,
返回1,因为回文分割结果[“aa”,“b”]是切割一次生成的。
Given a string s, partition s such that every substring of the partition is a palindrome.
Return the minimum cuts needed for a palindrome partitioning of s.

For example, given s =“aab”,
Return1since the palindrome partitioning[“aa”,“b”]could be produced using 1 cut.

20、 palindrome-partitioning-ii
思路:使用动态规划法,设计数组min[s.length()-1],min[i]用来表示s(0,i)的最小分割次数,数组dp[j][i]判断s(j,i)是否为回文串。

相关文章:

  • 2022-01-29
  • 2022-02-24
  • 2021-12-02
  • 2022-03-09
  • 2021-09-24
  • 2021-09-07
  • 2022-01-12
猜你喜欢
  • 2022-12-23
  • 2021-08-01
  • 2021-08-04
  • 2022-01-18
  • 2021-10-11
相关资源
相似解决方案