๋ฐ์ํ
๐ค๋ฌธ์ ํด๊ฒฐ
-
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
๋ฐ์ํ
'Algorithm Problem > Python' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[python] ๋ฐฑ์ค - 1747. ์์&ํฐ๋ฆฐ๋๋กฌ (0) | 2020.11.04 |
---|---|
[python] ๋ฐฑ์ค - 16916. ๋ถ๋ถ ๋ฌธ์์ด (0) | 2020.11.03 |
[python] SWEA - 10804. ๋ฌธ์์ด์ ๊ฑฐ์ธ์ (0) | 2020.11.01 |
[python] ๋ฐฑ์ค - 1012. ์ ๊ธฐ๋ ๋ฐฐ์ถ (0) | 2020.10.31 |
[python] ๋ฐฑ์ค - 14719. ๋น๋ฌผ (0) | 2020.10.30 |