[SW Academy] 10912. 외로운 문자 [D3]

DreamJJW·2023년 9월 29일
0

SW Academy

목록 보기
24/26

문제

풀이

t = int(input())
for test_case in range(t):
    s = input()
    s = sorted(s)

    temp = []
    for i in range(len(s)):
        if temp:
            if s[i] in temp:
                temp.pop()
            else:
                temp.append(s[i])
        else:
            temp.append(s[i])

    if temp:
        answer = "".join(temp)
    else:
        answer = "Good"

    print(f"#{test_case+1} {answer}")
profile
간절한 사람

0개의 댓글