본문 바로가기
Study/알고리즘

[백준 알고리즘] 1316번 Python

by Becoming a Hacker 2021. 10. 4.
반응형

문제 정보

 

제출 코드

count = int(input())
total = 0

for i in range(count):
	word = input()
	check = 0
	for i in range(len(word)-1):
		if(word[i]==word[i+1]):
			continue
		elif(word[i] in word[i+1:]):
			check = 1
			break
	if(check==0):
		total += 1

print(total)

댓글