Check Subset

Sort by

recency

|

949 Discussions

|

  • + 0 comments
    n = int(input())
    
    for _ in range(n):
        _ = input()
        a = set(input().split())
        _ = input()
        b = set(input().split())
        v = len(a) == len(a.intersection(b))
        print(v)
    
  • + 0 comments

    N=int(input()) for i in range(N): size=int(input()) A=set(map(int,input().split()))

    size_B=int(input())
    B=set(map(int,input().split()))
    
    if A.issubset(B):
        print(True)
    else:
        print(False)
    
  • + 0 comments

    if name == "main":

    def Action(T):
    
        for _ in range (T):
    
            length_A = int(input())
            A = set(map(int, input().split()))
    
            length_B = int(input())
            B = set(map(int, input().split()))
    
            print(A.issubset(B))
    
    T = int(input())
    Action(T)
    
  • + 0 comments

    print(*[(lambda a, set_a, b, set_b : set_b.issuperset(set_a))(input(), set(map(int, input().split())), input(), set(map(int, input().split()))) for _ in range(int(input()))], sep="\n")

  • + 0 comments
    for _ in range(int(input())):
        _,A = int(input()) , set(map(int,input().split()))
        _,B = int(input()) , set(map(int,input().split()))
        print(A.issubset(B)) # Alternative : print(A&B == A)