#include<bits/stdc++.h>
using namespace std;
int main()
{
int t, n, i;
cin >> t;
while(t--)
{
int n;
cin >> n;
int a[n];
for(i=0;i<n;i++)
{
cin >> a[i];
}
sort(a, a+n);
int c = 0, m = 0;
for(i=0;i<n-1;i++)
{
if(a[i] == a[i+1])
c++;
else
c = 0;
if(m < c)
m = c;
}
m++;
cout << n-m << endl;
}
return 0;
}
Comments
Post a Comment