Skip to content

Commit

Permalink
Merge pull request #30 from kjs254/8-kjs254
Browse files Browse the repository at this point in the history
8-kjs254
  • Loading branch information
kjs254 authored Mar 18, 2024
2 parents cfeb1c3 + 64756c3 commit 22050f6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 1 addition & 2 deletions kjs254/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
| 5μ°¨μ‹œ | 2024.02.24 | DFS | [λͺ¨μŒμ‚¬μ „](https://school.programmers.co.kr/learn/courses/30/lessons/84512) | [#19](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/19) |
| 6μ°¨μ‹œ | 2024.02.27 | μŠ€νƒ | [κ΄„ν˜Έ νšŒμ „ν•˜κΈ°](https://school.programmers.co.kr/learn/courses/30/lessons/76502) | [#22](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/22) |
| 7μ°¨μ‹œ | 2024.03.01 | κ΅¬ν˜„ | [μΊμ‹œ](https://school.programmers.co.kr/learn/courses/30/lessons/17680) | [#24](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/24) |
=======
---
| 8μ°¨μ‹œ | 2024.03.08 | κ΅¬ν˜„ | [νŠœν”Œ](https://school.programmers.co.kr/learn/courses/30/lessons/64065) | [#30](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/30) |
18 changes: 18 additions & 0 deletions kjs254/κ΅¬ν˜„/νŠœν”Œ.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
def solution(s):
answer = []
dic = {}
s = s.replace('{','').replace('}','').split(',')

for n in s:
n = int(n)
if n not in dic:
dic[n] = 1
else:
dic[n]+= 1

dic_sorted = sorted(dic.items(), key=lambda x:x[1], reverse=True)

for d in dic_sorted:
answer.append(d[0])

return answer

0 comments on commit 22050f6

Please sign in to comment.