Given a string you need to print the size of the longest possible substring that has exactly k unique characters. If there is no possible substring print -1.
For the string aabacbebebe and k = 3 the substring will be cbebebe with length 7.
The first line of input contains an integer T denoting the no of test cases then T test cases follow. Each test case contains two lines . The first line of each test case contains a string s and the next line conatains an integer k.
For each test case in a new line print the required output.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.