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 Subset
- Discussions
Check Subset
Check Subset
Sort by
recency
|
858 Discussions
|
Please Login in order to post a comment
PYTHON
Without using the subset() function:
for _ in range(int(input())): _ = int(input()) A = set(map(int, input().split())) _ = int(input()) B = set(map(int, input().split())) X = B.intersection(A) print(X == A)
n=int(input()) for i in range(n): num_A = input() A = set(input().split(' ')) num_B = input() B = set(input().split(' ')) print('True') if A <= B else print('False')