[백준 1316][Python] 그룹 단어 체커

봉글렛·2023년 1월 2일

백준

목록 보기
17/55

문제 링크 https://www.acmicpc.net/problem/1316

풀이

import sys

n = int(input())
for i in range(n):
    a = sys.stdin.readline().rstrip()
    b = [a[0]]
    for i in list(a):
        if b[-1] == i:
            b.append(i)
            continue
        elif i in b:
            n -= 1
            break
        b.append(i)

print(n)
profile
어쩌다 개발자 (할 수 있을 때까지!!!!)

0개의 댓글