108 lintcode 分割回文字符串二

https://blog.csdn.net/u012156116/article/details/80969459

该答案的主要问题在于,dp数组的长度为s.size()+1,其中dp[0]=-1;

可以想象的是如果不这样设置,s.substr(0,i)为回文串时,分割次数不为0 而为1;

   

你可能感兴趣的:(108 lintcode 分割回文字符串二)