Check Strict Superset

Sort by

recency

|

1161 Discussions

|

  • + 0 comments

    Read the main set A

    A = set(map(int, input().split()))

    Read number of other sets

    n = int(input())

    Assume A is a strict superset of all sets until proven otherwise

    is_strict_superset = True

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

    # Check if A is a strict superset of other_set
    if not (A > other_set):  # ">" checks for strict superset
        is_strict_superset = False
        break
    

    Print the final result

    print(is_strict_superset)

  • + 0 comments

    A=set(input().split()) n=int(input()) t=0 f=0 for i in range(n): N=set(input().split()) if A.issuperset(N): t=t+1 else: f=f+1 if f!=0: print('False') else: print('True')

  • + 0 comments

    a=set(map(int,input().split())) n=int(input()) s1=set(map(int,input().split())) s2=set(map(int,input().split()))

    if (a.intersection(s1)== s1 and len(a.difference(s1))>0) and (a.intersection(s2)== s2 and len(a.difference(s2))>0): print(True) else: print(False)

  • + 0 comments

    A = set(map(int, input().split())) for _ in range(int(input())): if not A>(set(map(int, input().split()))): print(False) break else: print(True)

  • + 0 comments
    1. s = set(map(int, input().split()))
    2. for _ in range(int(input())): 3. if not s > set(map(int, input().split())): 4. print(False) 5. break
    3. else:
    4. print(True)