
回文处理
UmdCoding
这个作者很懒,什么都没留下…
展开
-
9. Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.判断一个int数是否是回文? 解法:转换为字符串, 字符串判断回文很简单for (int i = 0, j = s.size() - 1; i != s.size() / 2; i++, j--){ if (s[i] != s[j]) re原创 2016-08-15 14:40:40 · 318 阅读 · 0 评论 -
5. Longest Palindromic Substring
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.分析:求最长的回文子串,时间赋值度n平方;aaa原创 2016-08-13 21:50:49 · 268 阅读 · 0 评论