삽집하는 개발들/알고리즘

[47일차][Lv1][프로그래머스][120869]외계어 사전

악투 2023. 8. 24. 19:58
반응형
def solution(spell, dic):
    for word in dic:
        result = 2
        for char in spell:            
            if char not in list(word):
                result = 2
                break
            else:
                result = 1
                
        if result == 1:
            return 1
        
    return result
반응형