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
|
1400 Discussions
|
Please Login in order to post a comment
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)
from collections import Counter
def calc_earnings(shoes, customers):
if name=='main':
Here is HackerRank collection.counter() in python solution - https://programmingoneonone.com/hackerrank-collections-counter-solution-in-python.html