collections.Counter()

  • + 0 comments

    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)