You are viewing a single comment's thread. Return to all comments →
from collections import Counter Shoes = int(input()) items = Counter(map(int, input().split())) customers = int(input()) s = 0 for _ in range(customers): size, price = map(int, input().split()) if size in items.keys(): s += price items[size] = items[size] - 1 if items[size] == 0: del items[size] print(s)``````
`
collections.Counter()
You are viewing a single comment's thread. Return to all comments →
`