728x90
반응형
문제 출처: https://school.programmers.co.kr/learn/courses/30/lessons/176963
풀이:
def solution(name, yearning, photo):
dic = {x:y for x,y in zip(name,yearning)}
res = []
for i in range(len(photo)):
result = 0
for z in photo[i]:
if z in dic:
result += dic[z]
res.append(result)
return res
반응형
댓글