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)
Please click on the like button if it worked

Solution not working or have any suggestions? Please send an email to [email protected]


donate a cup of tea :)


Join Our Facebook Group

Share this solution






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