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 STDOUTfromcollectionsimportCountern=int(input())available_shoes=list(map(int,(input()).split()))customers_qty=int(input())shoes_sizewise_qty=dict(Counter(available_shoes))customer_desired_shoe_size=[]size_1=[]money_1=[]foriinrange(customers_qty):customer_desired_shoe_size.extend(map(int,(input().split())))foriinrange(len(customer_desired_shoe_size)):ifi%2==0:ifcustomer_desired_shoe_size[i]inshoes_sizewise_qty.keys():ifshoes_sizewise_qty[customer_desired_shoe_size[i]]>=1:size_1.append(customer_desired_shoe_size[i])money_1.append(customer_desired_shoe_size[i+1])shoes_sizewise_qty[customer_desired_shoe_size[i]]-=1else:passtotal_earning=sum(money_1)print(total_earning)
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 →