Manacher Algorithm modified