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
- Set .union() Operation
- Discussions
Set .union() Operation
Set .union() Operation
Sort by
recency
|
773 Discussions
|
Please Login in order to post a comment
For Python3
n1 = int(input()) n1 = set(input().split())
n2 = int(input()) n2 = set(input().split())
print(len(n1.union(n2)))
n = int(input())
set1 = set(map(int, input().split()))
s = int(input())
set2 = set(map(int, input().split()))
print(len(set1 | set2))