You are viewing a single comment's thread. Return to all comments →
I dont know why 5 test cases are wrong.kindly help
mystr=input()#Taking n.m no value for me so discard
mystr=input()
mystr=mystr.rstrip()
myset=set(mystr.split())
mysetA=set(mystr.split())
mysetB=set(mystr.split())
x = myset.intersection(mysetA)
xlen=len(x)
x = myset.intersection(mysetB)
ylen=len(x)
happiness=abs(xlen-ylen) print(happiness)
Seems like cookies are disabled on this browser, please enable them to open this website
No Idea!
You are viewing a single comment's thread. Return to all comments →
I dont know why 5 test cases are wrong.kindly help
mystr=input()#Taking n.m no value for me so discard
mystr=input()
mystr=mystr.rstrip()
myset=set(mystr.split())
mystr=input()
mystr=mystr.rstrip()
mysetA=set(mystr.split())
mystr=input()
mystr=mystr.rstrip()
mysetB=set(mystr.split())
x = myset.intersection(mysetA)
xlen=len(x)
x = myset.intersection(mysetB)
ylen=len(x)
happiness=abs(xlen-ylen) print(happiness)