Algorithm/ํ๋ก๊ทธ๋๋จธ์ค
[ํ๋ก๊ทธ๋๋จธ์ค] ํํ (Python)
1. ๋ฌธ์ ์ค๋ช
๋ฌธ์ ๋งํฌ ์
๋ ฅ ๋ถ๋ถ ์งํฉ ์ถ๋ ฅ : ํํ 2. ์ฝ๋ solution1.py def solution(s): answer = [] s = s[2:-2] #2},{2,1},{2,1,3},{2,1,3,4 s = s.split("},{")#['2', '2,1', '2,1,3', '2,1,3,4'] s.sort(key = len) #['2', '2,1', '2,1,3', '2,1,3,4'] for ss in s: sss = ss.split(',') for j in sss: if int(j) not in answer: answer.append(int(j)) print('answer',answer) return answer 3. ํ๊ณ ๋ฌธ์ ์ดํด๊ฐ ์ด๋ ค์ ๋ค. ์์๋ฅผ ๋ณด๊ณ ๊ท์น์ฑ์ ์ฐพ๊ณ ํ์๋ค. ์์๋ฅผ ๋ณด..