Skip to content

Commit fcb73fd

Browse files
authored
Merge pull request #1206 from AlgorithmWithGod/lkhyun
[20251023] PGM / Lv2 / 튜플 / 이강현
2 parents c07765a + 8a8cf1a commit fcb73fd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lkhyun/202510/23 PGM Lv2 튜플.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
```python
2+
def solution(s):
3+
answer = []
4+
unions = s[2:-2].split("},{")
5+
6+
dic = {}
7+
for union in unions:
8+
u = list(map(int, union.split(",")))
9+
for i in u:
10+
dic[i] = dic.get(i,0) + 1
11+
12+
dic = sorted(dic.items(),key=lambda x : x[1],reverse=True)
13+
return [x[0] for x in dic]
14+
```

0 commit comments

Comments
 (0)