BOJ/백준-14425-python

cosmos·2022년 8월 24일
0
post-thumbnail
post-custom-banner

문제

코드

# https://www.acmicpc.net/problem/14425
# boj, 14425: 문자열 집합, python3
def solve(s: list, data_m: list) -> int:
    result = 0

    for x in s:
        if x in data_m:
            for y in data_m:
                if x == y:
                    result += 1

    return result

if __name__ == '__main__':
    n, m = map(int, input().split())
    s = [str(input()) for _ in range(n)]
    data_m = [str(input()) for _ in range(m)]

    print(solve(s, data_m))

결과

출처 & 깃허브

boj 14425
github

post-custom-banner

0개의 댓글