my solution was correct but wasnt accepted. wheres the problem?

#include <stdio.h>

int max(int count[]){

int i;int min=count[0];

for(i=0;i<=9;i++){

if(count[i]>min){

min=count[i];

}

}

return min;

}

int main(void) {

// your code goes here

int t,n,A[1000];

scanf("%d",&t);

while(t–){

scanf("%d",&n);

int i,j;

for(i=0;i<n;i++){

scanf("%d",&A[i]);

}

int count[1000]={0};

for(i=0;i<n;i++){

for(j=0;j<=9;j++){

if(A[i]==j){

count[j]++;

```
}
}
}
int min=n-max(count);
printf("%d\n",min);
}
return 0;
```

}