# 단어 공부
from sys import stdin
word = stdin.readline()
word = word.upper()
count = []
array = []
for i in range(len(word)-1):
array.append(word[i:i+1])
lst = set(array)
lst = list(lst)
for j in lst:
cnt = 0
for i in array:
if i == j:
cnt += 1
count.append(cnt)
k = 0
res = 0
for i in count:
if i == max(count):
res = count.index(i)
k += 1
if k >= 2:
print("?")
else:
print(lst[res])
[파이썬] 백준 1924: 2007년 (구현) (0) | 2021.08.28 |
---|---|
[파이썬] 백준 1316: 그룹 단어 체커 (구현, 문자열) (0) | 2021.08.28 |
[파이썬] 백준 1152: 단어의 개수 (구현, 문자열) (0) | 2021.08.28 |
[파이썬] 백준 5585: 거스름돈 (그리디 알고리즘) (0) | 2021.08.28 |
[파이썬] 백준 2217: 로프 (그리디 알고리즘) (0) | 2021.08.28 |