1
2
3
4
5
6
7
8
9
10
11
12
|
for _ in range(3):
s = str(input())
mymax = 1
cnt = 1
for i in range(1,len(s)):
if s[i]==s[i-1]:
cnt+=1
else:
mymax=max(cnt,mymax)
cnt=1
mymax = max(cnt, mymax)
print(mymax)
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
Hacker rank Print the Elements of a Linked List (0) | 2021.11.12 |
---|---|
백준 2745 진법 변환 (0) | 2021.11.02 |
백준 1371 가장 많은 글자 (0) | 2021.11.02 |
백준 20944 팰린드롬 척화비 (0) | 2021.11.02 |
백준 20540 연길이의 이상형 (0) | 2021.11.02 |
댓글