You are viewing a single comment's thread. Return to all comments →
Python 3
-
from collections import Counter input() # Useless info - ...the number of shoes. shoes = Counter(map(int, input().split())) customers = int(input()) income = 0 for customer in range(customers): # Can replace 'customer' with _ since it is not used. size, price = map(int, input().split()) if shoes[size]: income += price shoes[size] -= 1 print(income)
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 →
Python 3
-