1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
def sol(s):
cnt=0
days=1
string_list = []
for i in s:
if i in string_list:
pass
else :
if cnt>=3:
cnt=0
days+=1
string_list = []
string_list.append(i)
cnt+=1
return days
for i in range(int(input())):
print(sol(input()))
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
codeforces 200B - Drinks (0) | 2022.07.20 |
---|---|
leetcode 1702A - Round Down the Price (0) | 2022.07.19 |
codeforces 791A - Bear and Big Brother (0) | 2022.07.12 |
leetcode 2022. Convert 1D Array Into 2D Array (0) | 2022.07.11 |
leetcode 2215. Find the Difference of Two Arrays (0) | 2022.07.08 |
댓글