摘要:
题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.最长回文字串,原型应该是ACM一道题目,不过这个已经简化很多了,只要把每一个位置作为回文的中心,往两边匹配找到回文长度,返回这些长度中最大的即可。有一个要注意的地方是奇数与偶数的情况。代码: 1 string longestPalindrom.. 阅读全文
posted @ 2013-11-30 20:28
月窟仙人
阅读(139)
评论(0)
推荐(0)

浙公网安备 33010602011771号