You are viewing a single comment's thread. Return to all comments →
from collections import Counter num_of_shoes = int(input()) shoe_sizes = list(map(int, input().split())) shoe_count = dict(Counter(shoe_sizes)) num_of_customers = int(input()) total_value = 0 for i in range(num_of_customers): size, price = input().split() size = int(size) price = int(price) if shoe_count.get(size, 0) != 0: total_value += price shoe_count[size] -= 1 print(total_value)
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 →