Skip to content

Commit 88bc6b0

Browse files
authored
Add other's solution as comments
1 parent 03aaeda commit 88bc6b0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

programmers/Lv.1/failure_percent.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,24 @@ def solution(N, stages):
1010
# 실패율을 기준으로 내림차순으로 정리
1111
stage_info.sort(key=lambda x:-x[1])
1212
return [i[0] for i in stage_info]
13+
14+
# def solution(N, stages):
15+
# failure_rate = {}
16+
# stages_len = len(stages)
17+
18+
# for i in range(1, N+1):
19+
# if stages_len != 0:
20+
# stage_count = stages.count(i)
21+
# failure_rate[i] = stage_count/stages_len
22+
# stages_len -= stage_count
23+
# else:
24+
# failure_rate[i] = 0
25+
26+
# answer = sorted(failure_rate.keys(), key=lambda key: failure_rate[key], reverse=True)
27+
28+
# return answer
29+
30+
# N = 5
31+
# stages = [2, 1, 2, 6, 2, 4, 3, 3]
32+
33+
# print(solution(N, stages))

0 commit comments

Comments
 (0)