Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 编写一个函数,返回给定字符串中最长的回文
例如,给定的字符串是“google”,那么最长的对称字符串是“goog”,因此答案应该是4。有什么快速的算法来解决它?
最长(常见)回文字符串搜索类似于最长子序列问题。
试试这个n这个来详细了解它。