题目描述
Given a string s, check if it can be rotated to form a palindrome.
Example 1:
Input:
s = aaaab
Output: 1
Explanation: "aaaab" can be rotated to
form "aabaa" which is a palindrome.
Your Task:
You dont need to read input or print anything. Complete the function isRotatedPalindrome() which takes a string s as input parameter and returns 1 if rotated palindrome is possible, otherwise 0.
Expected Time Complexity: O(N^{2}) where N is length of s
Expected Auxiliary Space: O(N)
Constraints:
1 <= s.length() <= 10^{4}
输入格式
见题面
输出格式
见题面
样例输入
s = aaaab
样例输出
1