You are given a string
Constraints
The sum of
Input Specification
The first line contains a single integer
For each test case, there are two lines:
The first line contains a single integer
The second line contains a string
Output Specification
For each test case, output a single integer: the length of the longest substring of identical characters in
Sample Input
3
3
abc
4
aaab
4
baaa
Sample Output
2
4
4
Sample Explanation
For the first test case, changing any character to match one of its neighbors yields a substring of length
In the second test case, changing the last character to a
yields aaaa
as a substring with identical characters.
In the third test case, changing the first character to a
also yields aaaa
as a substring.
Comments