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
|
1423 Discussions
|
Please Login in order to post a comment
Without using the Counter:
my code without using any imports or libraries
x = int(input())
shoeSize = list(map(int, input().split()))
n = int(input())
total = 0
if (0 < x < 10**3) or (0 < n <= 10**3) or (20 < x_i < 100) or (2 < shoeSize < 20): for _ in range(n): size, price = map(int, input().split()) if size in shoeSize: total += price shoeSize.remove(size) print(total)