说点让大妈们高兴的:为什么私立高中不行? :)# Parenting - 为人父母
n*2
1 楼
according to jinfeng and many other posts:
find the longest palindrome in a string.
Solution: string A, reverse it becomes A’, so the problem changes to find
the longest common substring.
What if I have a string abcXYZcba. its reverse is: abcZYXcba.
Then the longest common substring would be "abc"(or cba). But "abc" is not
a palindrome!!1??? Somebody please tell me what I'm missing here?
find the longest palindrome in a string.
Solution: string A, reverse it becomes A’, so the problem changes to find
the longest common substring.
What if I have a string abcXYZcba. its reverse is: abcZYXcba.
Then the longest common substring would be "abc"(or cba). But "abc" is not
a palindrome!!1??? Somebody please tell me what I'm missing here?