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.
collections.Counter()
collections.Counter()
Sort by
recency
|
1402 Discussions
|
Please Login in order to post a comment
Here's my solution to this problem:-
from collections import Counter shoes=int(input()) shoe_size=list(map(int,input().split())) counter=Counter(shoe_size) customers=int(input()) lst=[] for i in range(1,customers+1): customer_info,price=map(int,input().split()) if counter[customer_info]>0: counter[customer_info]-=1 lst.append(price) else: pass print(sum(lst))
from collections import Counter list1 = [] def test(customer_shoe_size,price): if customer_shoe_size in shoe_sizes.keys(): value = shoe_sizes.get(customer_shoe_size) shoe_sizes.subtract([customer_shoe_size]) if value > 0: list1.append(int(price))
def sum_(): final = list(map(int,list1)) print(sum(final))
if name == "main": global shoe_sizes no_of_shoes = int(input()) shoe_sizes = Counter((map(str,input().split()))) no_of_customers = int(input()) for i in range(no_of_customers): customer_shoe_size , price = input().split() test(customer_shoe_size,price) sum_()
X = int(input()) tot_inv = list(map(int, input().split()))
from collections import Counter
inventory = Counter(tot_inv)
N = int(input())
raghu_earn = 0
for _ in range(N):
print(raghu_earn)
print(raghu_earn)