add: swea/1204.py
This commit is contained in:
17
swea/1204.py
Normal file
17
swea/1204.py
Normal 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])
|
||||
Reference in New Issue
Block a user