Algorithm/lanqiao/test/2020省单词分析.py

19 lines
343 B
Python
Raw Normal View History

2022-04-09 01:07:54 +08:00
import io
import sys
sys.stdin = io.StringIO('lanqiao')
s_in = input()
counter = [0] * 26
count_max = 0
for ch in s_in:
idx = ord(ch) - ord('a')
counter[idx] += 1
count_max = max(count_max, counter[idx])
for i in range(26):
if count_max == counter[i]:
print(chr(i + ord('a')))
print(count_max)
break