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.
fromcollectionsimportCounter# Enter your code here. Read input from STDIN. Print output to STDOUTx=int(input())sizes=map(int,input().split())n=int(input())avail=Counter(sizes)sales=0foriinrange(n):order=list(map(int,input().split()))size=order[0]ifsizeinavail.keys()andavail[size]>0:sales+=order[1]avail[size]-=1print(sales)
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 →