- you can insert the same numbers of characters to orginal string, and join a character in the last of orginal string, make the new string always has odd numbers of character, for solving the problem of parity.
for example: “babad” -> “#b#a#b#a#d#” -> “&#b#a#b#a#d#|”, (’&’ and ‘|’ are for avoiding judging out-of-array).
From Manacher’s algorithm.