Check Strict Superset

Sort by

recency

|

1133 Discussions

|

  • + 0 comments
    seta = list(map(int, input().split()))
    num = int(input())
    result=bool(True)
    for _ in range(num):
        setx = list(map(int, input().split()))
        for i in setx:
            if(i in seta):
                continue
            else:
                result = bool(False)
                break
    print(result)
    
  • + 0 comments
    a=set(map(int,input().split()))
    n=int(input())
    count=0
    for i in range(n):
        s=set(map(int,input().split()))
        if(s-a==set() and len(s)<len(a)):
            count+=1
    if count==n:
        print("True")
    else:
        print('False')
            
    
  • + 1 comment

    ` _set = set(map(int, input().split()))

    print(all([set(map(int, input().split())) <= _set for _ in range(int(input()))])) `

  • + 0 comments

    set_a = set(map(int, input().split())) n = int(input())

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

    # If set_a is not a strict superset of set_n, print False and break
    if not set_a > set_n:  # This checks if set_a is a strict superset
        print(False)
        break
    

    else: # If set_a is a strict superset of all sets, print True print(True)

  • [deleted]Challenge Author
    + 0 comments

    For Python3

    A = set(input().split())
    n = int(input())
    for i in range(n):
        s = set(input().split())
        
        if(len(s) == len(A)):
            print(False)
            break
        elif(not A.issuperset(s)):
            print(False)
            break
    else:
        print(True)