인천의 자유인

[Python] 외계어 사전 - 프로그래밍 본문

Python/Python코딩테스트

[Python] 외계어 사전 - 프로그래밍

Youngook 2024. 5. 2. 09:00
728x90
반응형

 

 

나의 문제 풀이

def solution(spell, dic):
    for i in dic:
        answer = 0
        for j in range(len(spell)):
            if spell[j] in i:
                answer +=1
            if answer == len(spell):
                return 1
    return 2
728x90
반응형