#33 : collections.Counter( ) | Hackerrank Python Solutions

preview_player
Показать описание
Thanks if u r Watching us....
#Python #Dev19 #Hackerrank #Programmers #Python3 #C #C++ #Java #Python #C
Please Subscribe Us ....
Рекомендации по теме
Комментарии
Автор

it's not necessary to include space characters in the split() function when reading integers separated by spaces. The split() function by default splits a string using whitespace characters (spaces, tabs, and newline characters) as separators, so if you're reading space-separated values, you can simply use input().split() without specifying a separator.
Thanks of your love to teach others

ReyJager
Автор

# Enter your code here. Read input from STDIN. Print output to STDOUT
n = int(input())

stock=list(map(int, input().split(' ')))

#print(stock)
from collections import Counter

Dict=Counter(stock)

x=int(input())

p=0
for i in range(x):
size, price=map(int, input().split(' '))

if Dict[size]:
Dict[size] -= 1
p=p+price

print(p)

shubhamkumarsaras
Автор

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)

immoshu
Автор

bro 6 no. shoes 2 pair but third input not countable why?

universalboxoffice
Автор

Thanks bro, very helpful..keep making such coding videos..

limitless_training
Автор

Why the map function is used ?
And what if we take int(input(). split ( ' ' )) to read the inputs size and price

dshaikhuzaifa
Автор

num_of_shoes = int(input())
shoe_list = [int(i) for i in input().split(" ")]
num_of_purchase = int(input())
total_value = 0

for i in range(num_of_purchase):
size, price = map(int, input().split(" "))
if size in shoe_list:
total_value += price
shoe_list.remove(size)

print(total_value)

viveknadar
Автор

Ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok

chesslover
Автор

thank you..benefited from your video!!

mohammedfaheem
Автор

Can you tell me dict[size] -=1 kiyoon aya ? I don't understand from there . Rest I understand

nadiaazam
Автор

Bhai English aati nahi hai toh, bolna itna jaruri bhi nahi h ...bole ja rahe hr kuch

raamiyaraamiya
join shbcf.ru