반응형
문제 설명
https://www.acmicpc.net/problem/1316
제출한 코드
num = int(input())
total = 0
for i in range(num) :
word = input()
j = 0
while j<len(word):
if word.count('*', j,len(word))>0 :
break
a = word.count(word[j])
word = word.replace(word[j],'*')
if a>1 :
j += a-1
if j==len(word)-1 :
total+=1
j+= 1
print(total)
결과
후기
반응형
'BQJ 백준 > python' 카테고리의 다른 글
[Python/파이썬] 백준 30306번: Better Dice (0) | 2024.06.13 |
---|---|
[Python/파이썬] 백준 1330번: 두 수 비교하기 (0) | 2024.06.12 |
[Python/파이썬] 백준 1271번: 엄청난 부자2 (0) | 2024.06.11 |
[Python/파이썬] 백준 1267번: 핸드폰 요금 (0) | 2024.06.09 |
[Python/파이썬] 백준 1264번: 모음의 개수 (0) | 2024.06.09 |