You are viewing a single comment's thread. Return to all comments →
from collections import Counter num_shoes = int(input()) size_inventory = Counter(int(x) for x in input().split()) num_customers = int(input()) customer_orders = [] profit = 0 for i in range(num_customers): customer_orders.append(tuple(int(x) for x in input().split())) for (size, price) in customer_orders: if size_inventory[size] > 0: size_inventory[size] -= 1 profit += price print(profit)
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 →