#32: Collection.Counter( ) | | Hacker Rank Python Solution | English Explanation
HTML-код
- Опубликовано: 11 сен 2024
- All the videos of python hackerrank series are available on channel
#collectioncounterhackerranksolution #collectioncounterhackerranksolution #python #hackerranksolution #hackerrankpythonsolution
#Python #Hackerrank
money = 0
x=int(input())
shoe_size = list (map(int,input().split(" ")))
number_of_customer = int(input())
for i in range(number_of_customer):
size,prize = map(int,input().split())
if size in shoe_size:
money = money+prize
shoe_size.remove(size)
print(money)
runtime error
code :
n=int(input())
from collections import Counter
stock=list(map(int,input().split(' ')))
dict=Counter(stock)
p=0
k=int(input())
for i in range(k):
size,price=map(int,input().split())
if dict[size]:
dict[size]-=1
p=p+price
print(p)
Thanks,
Keep Coding !
@@NSTuts no bro its still showing error
@@shubhambhosale8467 Bro there might be writing mistake in the code . As you can se in the video my code works fine. You send me code here i will check it otherwise mail me the screenshot of the error
Regards NS Tuts,
keep coding.
@@NSTuts mail id?
@@shubhambhosale8467 nihalsarmalkar1@gmail.com