Algorithm Problem/Python
[python] SWEA - 10912. ์ธ๋ก์ด ๋ฌธ์
deo2kim
2020. 11. 2. 08:15
๋ฐ์ํ

๐ค๋ฌธ์ ํด๊ฒฐ
-
lv3 | ๋ฌธ์์ด
๐จ ๋ถ์ด์๋ ๋ฌธ์๋ผ๋ฆฌ ์ญ์ ํ๋ ๊ฒ์ด ์๋๋ผ, ์ด๋์ ์๋ ๋ ๋ฌธ์๋ฅผ ์ฐ์ง์ผ๋ฉด ๋๋ค.
๐ป์์ค ์ฝ๋
for tc in range(int(input())):
word = list(input())
word.sort()
stack = []
for w in word:
if stack and stack[-1] == w:
stack.pop()
else:
stack.append(w)
if stack:
print(f'#{tc + 1} {"".join(stack)}')
else:
print(f'#{tc + 1} Good')
๐๋ฌธ์ ํ์ธ
์ถ์ฒ: SW Expert Academy
SW Expert Academy
SW ํ๋ก๊ทธ๋๋ฐ ์ญ๋ ๊ฐํ์ ๋์์ด ๋๋ ๋ค์ํ ํ์ต ์ปจํ ์ธ ๋ฅผ ํ์ธํ์ธ์!
swexpertacademy.com
๋ฐ์ํ