Check Subset

Sort by

recency

|

956 Discussions

|

  • + 0 comments

    T=int(input()) for i 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<=B)

  • + 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))