


The first line of input contains an integer ‘T’, denoting the number of test cases.
The first line of each test case contains one integer ‘N’, denoting the size of the array.
The following line contains an array ‘A’ of ‘N’ spaced integers.
For each test case, print one integer in a new line denoting the beauty of the frequencies of the values present in the array.
You are not required to print the expected output. It has already been taken care of. Just implement the function.
1 <= T <= 10
1 <= N <= 10^4
1 <= A[i] <= 10
Time Limit: 1 sec
In this approach, indeed of running a loop from 1 to 10 to count the frequency of each integer. We will declare another array of size 11 initialised to 0 and run a loop through the array only once. Whenever we reach any element, we will increment the value of the new array whose index is equal to the element. So we the element is 2, we will increment the value at index 2 of the new array.
Now we have an array showing the frequencies of all the elements in the original array, and we need to find the beauty value of this array which can be done as mentioned in the previous approach.