Transform s → T by inserting # separators, giving a unified odd-length treatment for all palindromes.
p[i] = radius of the longest palindrome centered at T[i].
Maintain a rightmost boundary R and its center C. For each new center i:
• If i < R, initialize p[i] = min(p[mirror], R-i) (free copy)
• Then expand naively from that starting radius.
This reuse of prior work gives O(n) overall — each character is visited at most twice.