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 .difference() Operation
- Discussions
Set .difference() Operation
Set .difference() Operation
Sort by
recency
|
372 Discussions
|
Please Login in order to post a comment
dont trust the constraints they are the ones that gives them but doesnt follow them and even shows us the error(here they told the sum of them should be less than 1000 ) but at last they give test cases where the value exceeds.
For Python3 Platform
n=int(input()) eng=set(map(int,input().split())) m=int(input()) french=set(map(int,input().split())) only_eng1=eng.difference(french) onlyeng2=list(only_eng1) print(len(onlyeng2))