Rotated palindrome implementation