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.
# Enter your code here. Read input from STDIN. Print output to STDOUTn,m=map(int,input().split())array_n=list(map(int,input().split()))set_a=set(map(int,input().split()))set_b=set(map(int,input().split()))happiness=0foriinarray_n:ifiinset_a:happiness+=1elifiinset_b:happiness-=1print(happiness)
n,m=list(map(int,input().split()))
arr=list(map(int,input().split()))
A,B=set(map(int,input().split())),set(map(int,input().split()))
a,b=[x for x in arr if x in A],[x for x in arr if x in B]
print(len(a)-len(b))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
n,m = map(int, input().split()) list1 = list(map(int, input().split())) set1 = set(map(int, input().split())) set2 = set(map(int, input().split())) happ = 0
happ = sum((i in set1) - (i in set2) for i in list1)
print(happ)
Here is HackerRank No Idea! in python solution - https://programmingoneonone.com/hackerrank-no-idea-problem-solution-in-python.html
A oneliner: