时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld
题目描述
You are given a string

of

lowercase letters.
You have to delete
exactly two letters from

, determine whether the string can become a palindrome after the change.
Definition of palindrome: If a string

of

lowercase letters is a palindrome, then for each
)
,

.
For example, “ababa” and “abba” are palindromes, but “abab” not.
输入描述:
The first line contains an integer
— the number of test cases.
For each test case, the first line contains an integer
representing the length of
, the second line contains a string of length
.
It is guaranteed that the sum of
for all test cases does not exceed
.
输出描述:
If it is possible to change the string into a palindrome after deleting two letters from
, please output “Yes”, otherwise output “No”.
示例1
输入
复制
3
4
abca
6
ababab
6
abcabc