Check Subset

Sort by

recency

|

942 Discussions

|

  • + 0 comments

    t=int(input())

    for _ in range(t): n=int(input()) a=set(map(int,input().split())) m=int(input()) b=set(map(int,input().split())) if a.intersection(b) == a: print(True) else: print(False)

  • + 0 comments

    T = int(input())

    for i in range(T):

    a = input()
    set_1 = set(map(int,input().split()))
    b = input()
    set_2 = set(map(int,input().split()))
    c = set_1.difference(set_2)
    if len(c)>0:
        print(False)
    else:
        print(True)
    
  • + 0 comments

    Here is HackerRank Check Subset in Python solution - https://programmingoneonone.com/hackerrank-check-subset-problem-solution-in-python.html

  • + 0 comments

    t = int(input()) for i in range(t): a = int(input()) a_set = set(map(int, input().split())) b = int(input()) b_set = set(map(int, input().split())) if a_set&b_set == a_set: print(True) else: print(False)

  • + 0 comments

    T = int(input())

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

    n = int(input())
    B = set(map(int, input().split()))
    
    print(A.issubset(B))