[백준] #1157 문자열 upper, lower python
2022. 12. 22. 13:19
https://www.acmicpc.net/problem/1157
upper, lower의 사용 알기.
S = input()
S_dict = {}
for i in S:
if i.upper() not in S_dict:
S_dict[i.upper()] = [0]
elif i.upper() in S_dict:
S_dict[i.upper()].append(0)
result = ""
max_ = -10000
for i in S_dict:
if len(S_dict[i]) > max_:
max_ = len(S_dict[i])
result = i
cnt = 0
for i in S_dict:
if len(S_dict[i]) == max_:
cnt += 1
if cnt > 1:
print("?")
else:
print(result)
'Programming > Algorithm' 카테고리의 다른 글
[백준] #2908 문자열 뒤집기 python (0) | 2022.12.22 |
---|---|
[백준] #1152 단어 개수 python (0) | 2022.12.22 |
[백준] #11720 문자열 반복 python (0) | 2022.12.22 |
[백준] #10809 알파벳 찾기 python (0) | 2022.12.22 |
[백준] #11720 필요없는 input 날리기 python (1) | 2022.12.22 |