https://school.programmers.co.kr/learn/courses/30/lessons/120835
def solution(emergency):
answer1 = []
answer2 = []
answer2 = sorted(emergency)
answer2.reverse()
# sorted(emergency, reverse=True) 한 줄로 가능
for i in emergency:
answer1.append(answer2.index(i)+1)
return answer1
def solution(emergency):
return [sorted(emergency, reverse=True).index(e) + 1 for e in emergency]
한 줄로 간단하게 나올 수 있었음