Algorithm/boj

[파이썬] 1371 가장 많은 글자

takeU 2022. 7. 17. 12:51
반응형
check = [0] * 26
while True:
    try:
        s = input()
        for c in s:
            if c != ' ':
                check[ord(c) - 97] += 1
    except:
        break
m = max(check)
for i, c in enumerate(check):
    if c == m:
        print(chr(i + 97), end='')

구현