Agorithm/백준 알고리즘
백준 알고리즘 9046번 복호화(python)
kimjinho1
2021. 2. 28. 20:44
728x90
반응형
단순 문자열 문제이다.
for _ in range(int(input())):
s = input()
li = [0]*26
for c in s:
if c.isalpha():
li[ord(c)-ord('a')] += 1
t = max(li)
print(chr(ord('a') + li.index(t)) if li.count(t) < 2 else '?')
728x90
반응형