코딩테스트/프로그래머스

[프로그래머스/PYTHON] 추억 점수

jinsang-2 2024. 5. 27. 09:35

https://school.programmers.co.kr/learn/courses/30/lessons/176963

def solution(name, yearning, photo):

    result=[]

    x={ na : yearning[nu] for nu , na in enumerate(name) }
    
    for i in photo:
        sum=0
        for j in i:
            if j in x:
                sum+=x[j]
        result.append(sum)

    print(result)
    return result