You are viewing a single comment's thread. Return to all comments →
nShoes = int(input()) nSizes = input().split() nSizes = list(map(lambda x: int(x), nSizes)) nCust = int(input()) totalEarnings = 0 for _ in range(nCust): preferSizePrice = input().split() preferSizePrice = list(map(lambda x: int(x), preferSizePrice)) if preferSizePrice[0] in nSizes: nSizes.remove(preferSizePrice[0]) totalEarnings += preferSizePrice[1] print(totalEarnings)
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 →
nShoes = int(input()) nSizes = input().split() nSizes = list(map(lambda x: int(x), nSizes)) nCust = int(input()) totalEarnings = 0 for _ in range(nCust): preferSizePrice = input().split() preferSizePrice = list(map(lambda x: int(x), preferSizePrice)) if preferSizePrice[0] in nSizes: nSizes.remove(preferSizePrice[0]) totalEarnings += preferSizePrice[1] print(totalEarnings)