Nasser will give you a string of lowercase English letters.
You are allowed to perform at most one operation:
Choose any position (1 \le i \le n)
Change the character to any lowercase letter from 'a' to 'z'
Your task is to determine the longest sorted substring you can achieve after performing at most one change.
A sorted substring is a contiguous part of the string where each character is greater than or equal to the previous one (non-decreasing order).
Each test contains multiple test cases. The first line contains a single integer (1 \le t \le 10^4) — the number of test cases. The description of the test cases follows.
The first line of each test case contains an integer (1 \le n \le 2 \cdot 10^5) — the length of the string.
The second line of each test case contains a string of length , consisting of lowercase English letters ('a' to 'z').
It is guaranteed that the sum of over all test cases does not exceed 2 \cdot 10^5.
For each test case, print a single integer — the length of the longest sorted substring that can be achieved after performing at most one character change.
Example 1
In the third test case, n=4, s=\texttt{``abca''}:
The string is not fully sorted since s[3]=\texttt{'c'} > s[4]=\texttt{'a'}.
We can change s[4]=\texttt{'a'} to : becomes , which is fully sorted. Length .
We can also change s[4]=\texttt{'a'} to : becomes , which is fully sorted. Length .
No single change can give a sorted substring of length greater than .
Answer: .
Subtask ( points) : (1 \le \sum n \le 1000)
Subtask ( points) : The string consists of at most distinct characters.
Subtask ( points) : No additional constraints.