Leetcode

最长回文子串Longest palindromic substring的四种算法

题目描述:

给定字符串$S$,求其最长的回文子串。

Leetcode:https://leetcode.com/problems/longest-palindromic-substring/

下面给出四种算法思路,分别是朴素枚举、动态规划、中心拓展和Manacher算法。

其中,Manacher算法复杂度为$O(n)$