728x90
반응형
모든 알파벳을 대문자로 바꾼 후에 개수를 새면 쉽다.
word = input().upper()
li = [0]*26
for l in word:
li[ord(l)-ord('A')] += 1
if li.count(max(li)) > 1:
print('?')
else:
print(chr(li.index(max(li))+65))
728x90
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
백준 알고리즘 1193번 분수찾기(python) (0) | 2020.01.26 |
---|---|
백준 알고리즘 1181번 단어 정렬(python) (0) | 2020.01.26 |
백준 알고리즘 1152번 단어의 개수(python) (0) | 2020.01.25 |
백준 알고리즘 1145번 적어도 대부분의 배수(python) (0) | 2020.01.25 |
백준 알고리즘 1138번 한 줄로 서기(python) (0) | 2020.01.24 |