https://school.programmers.co.kr/learn/courses/30/lessons/118666
input :
output :
조건 :
def solution(survey, choices):
answer = ''
data = dict()
for item in ["R", "T", "C", "F", "J", "M", "A", "N"]:
data[item] = 0
for i in range(len(survey)):
left, right = survey[i][0], survey[i][1]
value = 4 - choices[i]
if value > 0:
data[left] += abs(value)
else:
data[right] += abs(value)
if data["R"] >= data["T"]:
answer += "R"
else:
answer += "T"
if data["C"] >= data["F"]:
answer += "C"
else:
answer += "F"
if data["J"] >= data["M"]:
answer += "J"
else:
answer += "M"
if data["A"] >= data["N"]:
answer += "A"
else:
answer += "N"
return answer