

It is guaranteed that the input string is special.
The first line contains a single integer ‘T’ representing the number of test cases.
The first line of each test case will contain two integers ‘N’ and ‘P’ that denote the size of the string ‘S’ and the first letters of English alphabets used.
The second line of each test case will contain the string ‘S’ and String ‘S’ contains only lowercase letters i.e [a-z].
For each test case, you have to return a string if there is any string that is lexicographically larger than ‘S’ and also it must be special. If there is no such string of length ‘N’ then return “NO”.
Output for every test case will be printed in a separate line.
You don’t need to print anything; It has already been taken care of.
1 <= T <= 10^2
1 <= N <= 10^3
1 <= P <= 26
1 <= |S| <= 10^3
Time Limit: 1 sec
Approach: The basic idea of this approach is to find a proper character from last. If there is no such character then try to find an element present on the left of it. We will run it until we get a particular position that has the next character which can form a special string. If we reach in front of the string and do not find it even then, we will return “NO” and can say that no string of ‘N’ is present which is lexicographically larger than ‘S’ and is a special string.
Here is the algorithm:
specialString(S, N, P):
helper(ARR, CURRENT, P):