#33809: python解


joanyang1103 (純因)

學校 : 龍華科技大學
編號 : 191444
來源 : [180.177.104.232]
最後登入時間 :
2023-08-12 15:03:55
d267. 11577 - Letter Frequency -- UVa11577 | From: [180.177.104.232] | 發表日期 : 2023-02-04 15:02

n = int(input())
for i in range(n):
    s = input()
    dic = {}
    for c in s:
        if not c.isalpha():
            continue
        c = c.lower()
        dic[c] = dic.get(c, 0) + 1
    mx = max(dic.values())
    for c in sorted(dic.keys()):
        if dic[c] == mx:
            print(c, end="")
    print()
 
ZeroJudge Forum