Category: Manacher
The Manacher’s Algorithm Template
Posted on
The Manacher algorithm is a linear algorithm to calculate the total number of palindromic substring of the given string (also the longest palindromic substring). The problem has other solutions, including O(n^2) dynamic programming and O(nlogn) rolling hash + binary search result. Reference https://cp-algorithms.com/string/manacher.html