Manacher's algorithm implemented