add: swea/1204.py

This commit is contained in:
Gyubin Han
2024-05-09 01:51:26 +09:00
parent 81182f9555
commit 79b09c1a5c

17
swea/1204.py Normal file
View File

@@ -0,0 +1,17 @@
t=int(input())
for _ in range(1,t+1):
tc=int(input())
arr=list(map(int,input().split()))
cnt={}
mx=(0,0)
for i in arr:
if i in cnt:
cnt[i]+=1
else:
cnt[i]=1
if cnt[i]>mx[1] or (cnt[i]==mx[1] and i>mx[0]):
mx=(i,cnt[i])
print("#"+str(tc),mx[0])