You are viewing a single comment's thread. Return to all comments →
from collections import Counter x = int(input()) size = list(map(int, input().split())) size_count = Counter(size) cus = int(input()) total = 0 for _ in range(cus): s, cost = map(int,input().split()) if size_count[s] > 0: # if stock available size_count[s] -= 1 total += cost print(total)
Seems like cookies are disabled on this browser, please enable them to open this website
collections.Counter()
You are viewing a single comment's thread. Return to all comments →