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)




codesadda.com

Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube