Check Subset

Sort by

recency

|

955 Discussions

|

  • + 0 comments

    if name == 'main': n = int(input()) ans = [] for _ in range(n): n_A = int(input()) A = set(map(int, input().split()))

        n_B = int(input())
        B = set(map(int, input().split()))
    
        if all(ele in B for ele in A):
            ans.append(True)
        else:
            ans.append(False)
    
    for answer in ans:
        print(answer)
    
  • + 0 comments
    T = int(input())
    for _ in range(T):
        NUMA, SETA = int(input()), set(map(int, input().split()))
        NUMB, SETB = int(input()), set(map(int, input().split()))
        print(SETA <= SETB)
    
  • + 0 comments

    For Python3 Platform

    T = int(input())
    for _ in range(T):
        n_A = int(input())
        A = set(map(int, input().split()))
        n_B = int(input())
        B = set(map(int, input().split()))
        
        print(A.issubset(B))
    
  • + 0 comments
    t = int(input())
    for _ in range(t):
        a_n = int(input())
        A = set(map(int, input().split()))
        b_n = int(input())
        B = set(map(int, input().split()))
        print(A.issubset(B))
    
  • + 0 comments

    number_of_test_case = int(input())

    for _ in range(number_of_test_case): A_number_elements = int(input()) space_separated_elements_A = set(map(int,input().split()))

    B_number_elements = int(input())
    space_separated_elements_B = set(map(int,input().split()))
    
    if space_separated_elements_A <= space_separated_elements_B:
        print("True")
    elif not space_separated_elements_A <= space_separated_elements_B:
        print("False")