HackerRank Python - Check Strict Superset



You are given a set A and N other sets.
Your job is to find whether set A is a strict superset of each of the N sets.

Print True, if A is a strict superset of each of the N sets. Otherwise, print False.

A strict superset has at least one element that does not exist in its subset.



  1. # Enter your code here. Read input from STDIN. Print output to STDOUT
  2. A = set(input().split())
  3. n = int(input())
  4. check = True
  5. for i in range(n):
  6. s = set(input().split())
  7. if (s&A != s) or (s == A):
  8. check = False
  9. break
  10. print(check)

download android app