본문 바로가기
코딩테스트/Python

프로그래머스 스쿨 - 배열의 유사도(Python)

by 보안매크로 2023. 8. 12.
728x90
def solution(s1, s2):
    answer = 0
   
    for i in range(len(s1)) :
        for j in range(len(s2)):
            if s1[i] == s2[j]:
                answer +=1
           
    return answer

#다른 사람의 풀이

# def solution(s1, s2):
#     return len(set(s1)&set(s2));
728x90