You are viewing a single comment's thread. Return to all comments →
from collections import Counter total_shoes = int(input()) shoe_sizes = [int(i) for i in input().split()] shoe_sizes = Counter(shoe_sizes) customer = int(input()) profit = 0 for i in range(0,customer): each_cus = [int(i) for i in input().split()] if shoe_sizes.get(each_cus[0]) is not None and shoe_sizes.get(each_cus[0]): shoe_sizes.update({each_cus[0] : -1}) profit += each_cus[1] 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 →