collections.Counter()

  • + 0 comments

    noob coder

    num_shoes = int(input()) shoe_sizes = list(map(int, input().split())) number_of_customers = int(input()) total = 0

    for i in range(number_of_customers): size, amount= list(map(int, input().split()))

    if size in shoe_sizes:
        total += amount
        shoe_sizes.remove(size)
    

    print(total)