Check Subset

Sort by

recency

|

918 Discussions

|

  • + 0 comments

    n = int(input())

    for i in range(n):

    set_a_ele_num = int(input())
    
    set_a = set(input().split())
    
    set_b_ele_num = int(input())
    
    set_b = set(input().split())
    
     print(set_a.issubset(se
        t_b))
    
  • + 0 comments
    for _ in range(int(input())):
        input(); a = set(map(int, input().split()))
        input(); b = set(map(int, input().split()))
        print(a.issubset(b))
    

    a slightly more compact code

  • + 0 comments
    t = int(input())
    
    for _ in range(t):
        _=input()
        a = set(map(int, input().split()))
        _=input()
        b = set(map(int, input().split()))
        
        print(a.issubset(b))
    
  • + 0 comments

    n=int(input())

    for _ in range(n): a=int(input()) set_a=set(map(int,input().split()))

    b=int(input())
    set_b=set(map(int,input().split()))
    
    if set_a.issubset(set_b):
        print("True")
    else:
        print("False")    
    
  • [deleted]Challenge Author
    + 0 comments

    For Python3

    T = int(input())
    
    for i in range(T):
        a = int(input())
        A = set(input().split())
        b = int(input())
        B = set(input().split())
        
        print(A.issubset(B))