jmpark0118 / CODING_TEST_PRACTICE

0 stars 0 forks source link

Practice>Python>Sets>Check Subset #69

Open jmpark0118 opened 4 years ago

jmpark0118 commented 4 years ago

image image

출처 : https://www.hackerrank.com/challenges/py-check-subset/problem

jmpark0118 commented 4 years ago

if __name__ == '__main__':
    test_case = int(input())

    for _ in range(test_case):
        element_a = int(input())
        A = set(map(int, input().split()))

        element_b = int(input())
        B = set(map(int, input().split()))

        i = 0
        for a in A:
            if a not in B:
                print('False')
                break
            else:
                i += 1
            if i == element_a:
                print('True')
jmpark0118 commented 4 years ago

if __name__ == '__main__':
    test_case = int(input())

    for _ in range(test_case):
        element_a = int(input())
        A = set(map(int, input().split()))

        element_b = int(input())
        B = set(map(int, input().split()))

        if A.issubset(B):
            print('True')
        else:
            print('False')