You are viewing a single comment's thread. Return to all comments →
from collections import Counter n_shoes = int(input()) sizeList = input().split(' ') sizeCounter = Counter(sizeList) n_customer = int(input()) sum_ = 0 for _ in range(n_customer): desire_list = input().split(' ') if desire_list[0] in sizeCounter.keys() and sizeCounter[desire_list[0]] != 0: sum_ += int(desire_list[1]) sizeCounter[desire_list[0]] -=1 print(sum_)
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 →