You are viewing a single comment's thread. Return to all comments →
from collections import Counter X = input() number_of_shoes = map(int, input().split()) inventory = Counter(number_of_shoes) earnings = 0 for _ in range(int(input())): size, price = map(int, input().split()) if inventory[size] > 0: inventory[size] -= 1 earnings += price print(earnings)
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 →