This is my code:

```
t=int(input())
for i in range(t):
n=int(input())
arr=list(map(int,input().split()))
d=[0]*100
for i in arr:
d[i]+=1
c=[0]*100
for j in d:
if(j!=0):
c[j]+=1
k=max(c)
print(c.index(k,0,len(c)))
```