Check Strict Superset

  • + 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)