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.
Set .intersection() Operation
Set .intersection() Operation
+ 0 comments eng = int(input()) eng_roll = set(map(int, input().split())) frn = int(input()) frn_roll = set(map(int, input().split())) total = eng_roll.intersection(frn_roll) print(len(total))
+ 0 comments n, set_n = int(input()), set(map(int, input().split())) b, set_b = int(input()), set(map(int, input().split())) both_subs = set_n.intersection(set_b) print(len(both_subs))
+ 0 comments n = int(input()) eng_rollnos = set(map(int, input().split())) b = int(input()) fre_rollnos = set(map(int, input().split())) result = eng_rollnos.intersection(fre_rollnos) print(len(result))
+ 0 comments input() #discard arbitrary input studeng = set(input().split()) input() #discard arbitrary input studfre = set(input().split()) print(len(studeng.intersection(studfre)))
+ 0 comments n,s1=input(),set(input().split()) n,s2=input(),set(input().split()) print(len(s1.intersection(s2)))
Load more conversations
Sort 379 Discussions, By:
Please Login in order to post a comment