๋์ ์ฝ๋
def solution(N, stages):
arr = []
hash = {}
answer = []
stages.sort(reverse=False)
for i in range(1,N+1):
arr.append(i)
for l in arr:
if l in stages:
hash[l] = stages.count(l)/len(stages[stages.index(l):])
else:
hash[l] = 0
hash = sorted(hash.items(), key = lambda x: x[1], reverse=True)
for i in range(len(hash)):
answer.append(hash[i][0])
return answer
'Algorithm > Programmers' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Programmers] ์์ฅ (0) | 2022.05.18 |
---|---|
[Programmers] K๋ฒ์งธ ์ (0) | 2022.05.07 |
[Programmers] ๋ชจ์๊ณ ์ฌ (0) | 2022.05.05 |
[Programmers] JadenCase ๋ฌธ์์ด ๋ง๋ค๊ธฐ (0) | 2022.05.04 |
[Programmers] ์ซ์์ ํํ (0) | 2022.05.04 |