백준 1157번 Python 풀이

Myeonggeun Shin·2025년 1월 27일

문제

백준 1157번
제목 : 단어 공부


풀이

# Python3
s = input().upper()
s_list = list(set(s))
cnt = []

for i in s_list:
    cnt.append(s.count(i))

if cnt.count(max(cnt)) > 1:
    print('?')
else:
    print(s_list[cnt.index(max(cnt))])

0개의 댓글