If you enjoyed this video, make sure to checkout my other video Capitalize! problem from HackerRank - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-iV2ezsexlE8.html. Don't forget to like , subscribe and share with others who can learn from it. Thanks.
happiness=0 n,m=map(int,input().split()) array=list(map(int,input().split())) A=set(map(int,input().split())) B=set(map(int,input().split())) for i in array: if i in A: happiness+=1 elif i in B: happiness-=1 print(happiness)