Naseem is working on "The Line", a project involving $$$n$$$ buildings arranged in a sequence. The design for each building is represented by a character in a string $$$s = s_1s_2\dots s_n$$$ of length $$$n$$$, using lowercase Latin letters ('a'-'z').
Naseem defines the beauty of "The Line" based on its string representation $$$s$$$. The beauty is the length of the longest prefix of $$$s$$$ consisting of only one distinct character. Formally, it's the largest integer $$$x \le n$$$ such that all characters $$$s_1, s_2, \dots, s_x$$$ are identical. (For example, the beauty of "aaabbc" is $$$3$$$, the beauty of "b" is $$$1$$$).
To potentially improve the beauty, Naseem can perform the following operation at most once: choose a (possibly empty) contiguous substring $$$s[l..r]$$$ ($$$1 \le l \le r \le n$$$) and delete it. The remaining parts of the string (if any) are concatenated together in their original order.
Your task is to help Naseem find the maximum possible beauty achievable for "The Line" after performing the operation at most once.
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 10^4$$$), the number of test cases.
Then $$$T$$$ test cases follow.
The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 2 \times 10^5$$$), the length of the string $$$s$$$.
The second line of each test case contains the string $$$s$$$ ($$$|s| = n$$$), consisting of lowercase Latin letters.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \times 10^5$$$.
For each test case, print a single integer representing the maximum possible beauty Naseem can achieve.
54aabb1d5aabaa8addzyyyd10ffffffffff
2 1 4 3 10
In the first test case, Naseem cannot delete any substring of $$$s$$$ to get a larger beauty, so the answer is $$$2$$$.
In the fourth test case, Naseem can delete the first four characters of $$$s$$$, leaving $$$s = \text{yyyd}$$$. The beauty of this string is $$$3$$$.