Palindrome Partitioning II

这里我们考虑两种情况:

  1. 如果前i个字符是palindrome那么mincut为0,此刻就已经完成对前i字符的判断了
  2. 如果前i个字符不是palindrome那么如果我们根据前j个字符得到mincut为1,此刻也已经完成对前i字符的判断了,因为1是非palindrome的最小cut数的。

results matching ""

    No results matching ""