We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
# Enter your code here. Read input from STDIN. Print output to STDOUTnum_shoes=int(input())shoes=list(map(int,input().split(' ')))sizes={}# build shoe sizes dictionaryforiinshoes:ifiinsizes:sizes[i]+=1else:sizes[i]=1num_customers=int(input())customers=[]profit=0foriinrange(num_customers):size,cash=map(int,input().split(' '))ifsizeinsizes:ifsizes[size]!=0:profit+=cashsizes[size]-=1print(profit)
Cookie support is required to access HackerRank
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 →
Without using the Counter: