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