Why it matters

Manacher's is linear palindrome finder. Standard competitive tool.

Advertisement

The architecture

Track palindrome centers.

Use symmetry to reuse.

Linear time.

Manacher's algorithmPalindrome centerstrack boundariesSymmetryreuse computationsLinearO(n)Manacher 1975; elegant O(n); standard for palindrome problems
Manacher's algorithm.
Advertisement

How it works end to end

Manacher 1975.

Center-based.

Reuse via symmetry.