My issue
My code
import java.lang.*;
import java.io.*;
import java.util.*;
class Codechef
{
public void main(String[] args) throws java.lang.Exception
{
Scanner kb = new Scanner(System.in);
int t = kb.nextInt();
while(t-->0)
{
int n = kb.nextInt();
int a [] = new int[n];
for(int i=0;i<n;i++)
{
a[i] = kb.nextInt();
}
Arrays.sort(a);
int Mcount = 0;
for(int i = 0;i<n-1;i++)
{
int c = 0;
for(int j=0;j<n;j++)
{
if(a[i] == a[j])
{
c++;
}
}
if(c>Mcount)
{
Mcount=c;
}
}
System.out.println(n - Mcount);
}
}
}
Problem Link: PAIREQ Problem - CodeChef