https://school.programmers.co.kr/learn/courses/30/lessons/118666
def solution(survey, choices):
type_lst = ['R', 'T', 'C', 'F', 'J', 'M', 'A', 'N']
type_dict = dict()
for t in type_lst:
type_dict[t] = 0
for s, c in zip(survey, choices):
not_t = s[0]
agree_t = s[1]
if c < 4:
type_dict[not_t] += 4-c
elif c > 4:
type_dict[agree_t] += c-4
print(type_dict)
answer = ''
if type_dict['R'] >= type_dict['T']:
answer+='R'
else:
answer+='T'
if type_dict['C'] >= type_dict['F']:
answer+='C'
else:
answer+='F'
if type_dict['J'] >= type_dict['M']:
answer+='J'
else:
answer+='M'
if type_dict['A'] >= type_dict['N']:
answer+='A'
else:
answer+='N'
return answer