본문 바로가기

Programming [Python]/백준 알고리즘 솔루션

#43 백준 파이썬 [1316] 그룹 단어 체커

https://www.acmicpc.net/problem/1316




#Solution



case_num = int(input())
answer = []
for i in range(case_num):
word = list(str(input()))

for k in range(len(word)):
if k != len(word)-1 and word[k] == word[k+1]:
pass
elif word[k+1:].count(word[k]) != 0:
break
elif k == len(word) - 1:
answer.append(i)

print(len(answer))