Python Dictionary, Defaultdict, and Counter Tricks

preview_player
Показать описание
FAANG Coding Interviews / Data Structures and Algorithms / Leetcode
Рекомендации по теме
Комментарии
Автор

Master Data Structures & Algorithms For FREE at AlgoMap.io!

GregHogg
Автор

the 'no i'm good' timing was perfect

johnjaques
Автор

Flexing is cooler in c++ imo cuz python is basically an english dialect at this point

guilhermewxs
Автор

u can just use counter[c] = counter.get(c, 0) + 1. there isn’t a need for default dict

timothylee
Автор

With normal dict you can also avoid if else by writing ‘ counter[c]=counter.get(c, 0) +1 ‘

andreaberetta
Автор

Join my DSA Discord community! Check my recent YouTube community post to get the link :)

GregHogg
Автор

Whats the time differences between that Counter function and the regular way which all can write and dont need to read the code how Counter from collection really works, to avoid fails? They invent the wheel new?

eduardprivat
Автор

Nice. Sometimes idk if python having think of different functionality is good or not.
Like it probably have a function for every common thing.

Also
The no key exist in dictionary error. Is such a good experience.
I just usually handle it with Key Exception. But using default dictionary seems good.

asagiai
Автор

I knew about defaultdict(int) and defaultdict(list) which I use all the time in python, but I didn’t know Counter was literally just defaultdict(int) 🤯

javierclement
Автор

"how to get the dicts out apparently 😂

bioblade
Автор

doesnt it do the same thing behind the the scenes?

vorkutavorkutlag
Автор

Python comes in clutch, yet again. They made it such an easy and convenient language to work with, love it.

blake_dexter
Автор

Hi Sir I am Aqib from India.
Can you plz make a video on all data structures in python (Advanced) of 2-3 hours

aqib
Автор

Are we allowed to use these in a technical interview?

THK
Автор

It's there step process: Learn coding, earn money, do flirting

pulkitjain
Автор

Appreciate bro keeping it halal. Hash Maps over Harsh Mouths! FAANG over Flings!

istiaqueahmed
Автор

How much slower is the first method than the other two methods?

Ridgwaycer
Автор

Why use a dictionary? If it were in C++ I’d make an array of 26 elements, then add to index c-‘a’

spdjoker
Автор

That default dict behaved like an unordered map from c++.

JugMelodies
Автор

He is a true programmer, he skips the girls to program 😢😢

amrswalha