python-algorithm
백준 26004 HI-ARC
무적김두칠
2022. 12. 28. 16:33
https://www.acmicpc.net/problem/26004
26004번: HI-ARC
첫째 줄에 문자열 $S$의 길이 정수 $N$이 주어진다. ($1 \leq N \leq 100\,000$) 둘째 줄에 문자열 $S$가 주어진다. 문자열 $S$의 모든 문자는 영어 대문자이다.
www.acmicpc.net
1
2
3
4
5
6
7
8
9
10
|
def sol(s):
h,i,a,r,c = s.count('H'),s.count('I'),s.count('A'),s.count('R'),s.count('C')
answer = min(h,i,a,r,c)
return answer
if __name__ == '__main__':
n = int(input())
s = input()
print(sol(s))
|
cs |
반응형