We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Sets
- Check Strict Superset
- Discussions
Check Strict Superset
Check Strict Superset
Sort by
recency
|
1161 Discussions
|
Please Login in order to post a comment
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()))
Print the final result
print(is_strict_superset)
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')
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)
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)