[SWEA] 11856 반반

김은서·2021년 9월 24일
0

SWEA

목록 보기
37/47

Python Code

T = int(input())
for tc in range(1, T+1):
    S = list(map(str, input()))
    result = 0
    for i in range(4):
        count = 0
        for j in range(4):
            if S[i] == S[j]:
                count += 1
        if count == 2:
            result += 1
    if result == 4:
        print('#{} Yes'.format(tc))
    else:
        print('#{} No'.format(tc))
profile
Gracelog

0개의 댓글