def solution(N, stages):
answer = []
sum = 0
result = []
for s in range(1,N+1):
if len(stages)-sum == 0:
result.append((s,0))
else:
result.append((s,stages.count(s)/(len(stages)-sum)))
sum += stages.count(s)
result.sort(key = lambda x :(-x[1], x[0]))
for r in result:
answer.append(r[0])
return answer
(stage,실패율) 리스트에서 실패율은 내림차순, stage는 오름차순 정렬