Link : https://programmers.co.kr/learn/courses/30/lessons/64065
Python
더보기
1
2
3
4
5
6
7
8
9
10
11
|
def solution(s):
s = s.replace(',', ' ').replace('{', ' ').replace('}', ' ')
result = list(map(int, s.split()))
data = dict()
for i in result:
if i not in data:
data[i] = 0
data[i] += 1
answer = list(data.items())
answer.sort(key=lambda x: x[1], reverse=True)
return [i[0] for i in answer]
|
cs |
FeedBack
cjw.git@gmail.com
'알고리즘 > 소스코드' 카테고리의 다른 글
PROGRAMMERS 77486: 다단계 칫솔 판매 (0) | 2021.12.31 |
---|---|
PROGRAMMERS 72411: 메뉴 리뉴얼 (0) | 2021.12.31 |
LEETCODE 287: Find the Duplicate Number (0) | 2021.08.05 |
LEETCODE 128. Longest Consecutive Sequence (0) | 2021.08.05 |
LEETCODE 46: PERMUTATIONS (0) | 2021.08.05 |
댓글