You are viewing a single comment's thread. Return to all comments →
The problem is quickly resolved by using list comprehensions. This is my solution in Python 3:
n, m = input().split() arr = [int(x) for x in input().split()] A = set([int(y) for y in input().split()]) B = set([int(z) for z in input().split()]) count = [0 + 1 if x in A else 0-1 if x in B else 0 + 0 for x in arr] print(sum(count))
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 →
The problem is quickly resolved by using list comprehensions. This is my solution in Python 3: