You are viewing a single comment's thread. Return to all comments →
from collections import Counter from operator import itemgetter n, m = map(int, input().split()) arr = map(int, input().split()) A = map(int, input().split()) B = map(int, input().split()) counter = Counter(arr) happiness = sum(itemgetter(*A)(counter)) sadness = sum(itemgetter(*B)(counter)) print(happiness - sadness)
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 →