https://programmers.co.kr/learn/courses/30/lessons/64065
def solution(s):
answer = []
s = s[2:-2]
s = s.split("},{")
s.sort(key = len) #๊ธธ์ด๊ธฐ์ค์ผ๋ก sort()
for ss in s:
sss = ss.split(',')
for j in sss:
if int(j) not in answer:
answer.append(int(j))
return answer
'Algorithm > ํ๋ก๊ทธ๋๋จธ์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํ๋ก๊ทธ๋๋จธ์ค] ์์ฐ - Python (0) | 2021.06.22 |
---|---|
[ํ๋ก๊ทธ๋๋จธ์ค] ๋ฉ์ฉกํ ์ฌ๊ฐํ - Python (1) | 2021.06.02 |
[ํ๋ก๊ทธ๋๋จธ์ค] ์์ด ๋๋ง์๊ธฐ - Python (0) | 2021.05.18 |
[ํ๋ก๊ทธ๋๋จธ์ค] ์ฒด์ก๋ณต - Python (0) | 2021.05.18 |
[ํ๋ก๊ทธ๋๋จธ์ค] ๋ฉ๋ด๋ฆฌ๋ด์ผ - Python (0) | 2021.05.18 |