#C8205. Rotational Palindrome
Rotational Palindrome
Rotational Palindrome
You are given a string s
consisting only of lowercase English letters. Your task is to determine whether it is possible to rotate the string (i.e. split the string into two parts and swap them) to form a palindrome.
A rotation of a string s
can be defined as:
$$rotate(s, i) = s[i:] + s[:i]$$
for some i such that 0 \le i < |s|
. If at least one rotation results in a palindrome, print "Yes"; otherwise, print "No".
Note: A palindrome is a string that reads the same forwards and backwards.
inputFormat
A single line containing the string s (only lowercase English letters).
outputFormat
Print "Yes" if there exists at least one rotation of s that is a palindrome, otherwise print "No".## sample
aabb
Yes