You are viewing a single comment's thread. Return to all comments →
from collections import Counter X = input() # number of shoes shoeSizes = Counter(list(map(int, input().split()))) N = int(input()) total = 0 for _ in range(N): customer = list(map(int, input().split())) try: shoseSize = shoeSizes[customer[0]] if shoeSizes[customer[0]] > 0: total += customer[1] shoeSizes[customer[0]] -= 1 except: pass 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 →