Problem Details
Minimum sum of squares of character counts in a given string after removing “k” characters.


1) The string contains only lowercase English letters.
2) The length of the string is at least 1.
3) It is guaranteed that K <= N.
4) Let S = aab, character count for a is 2 and that of b is 1. So, the sum of squares will be 2^2 + 1^2 = 5.
The first line of the input contains an integer T denoting the number of test cases.
The first line of each test case contains two space-separated integers, N and K, as described in the problem statement.
The second line of each test case contains a string S of length N.
For each test case print in a new line, an integer denoting the minimum sum of squares of unique character counts after removing K characters.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 20
1 <= N <= 10^4
1 <= K <= N
Time Limit: 1sec