레벨1 문제
def solution(weights, head):
sett = []
for i in range(len(weights)):
# 승률 구하기
w = head[i].count('W')
l = head[i].count('L')
if ( w + l == 0):
temp = 0
else:
temp = w / (w + l)
# 무거운 복서를 이긴 횟수 구하기
cnt = 0
for j in range(len(weights)):
if ( head[i][j] == 'W' and weights[i] < weights[j]):
cnt += 1
sett.append([temp, cnt, weights[i], i+1])
sett.sort(key = lambda x:(-x[0], -x[1], -x[2]))
answer = []
for i in sett:
answer.append(i[3])
return answer