High Definition Standard Definition Theater
Video id : XiQ4N6mGOTw
ImmersiveAmbientModecolor: #84949b (color 2)
Video Format : (720p) openh264 ( https://github.com/cisco/openh264) mp4a.40.2 | 44100Hz
Audio Format: 140 ( High )
PokeEncryptID: 449a0c72e7b0704cd1cdda6ef38d79c6af0694895634e2174aee583a3774a5b3247a8dc537ea432c8380bbc12cee63ba
Proxy : cal1.iv.ggtyler.dev - refresh the page to change the proxy location
Date : 1732404807630 - unknown on Apple WebKit
Mystery text : WGlRNE42bUdPVHcgaSAgbG92ICB1IGNhbDEuaXYuZ2d0eWxlci5kZXY=
143 : true
Python Counter / Defaultdict / Dictionary
 60 FPS video
52,795 Views • Nov 4, 2024 • Click to toggle off description
Python Counter / Defaultdict / Dictionary
Metadata And Engagement

Views : 52,795
Genre: Education
Uploaded At Nov 4, 2024 ^^


warning: returnyoutubedislikes may not be accurate, this is just an estiment ehe :3
Rating : 4.914 (48/2,197 LTDR)

97.86% of the users lieked the video!!
2.14% of the users dislieked the video!!
User score: 96.79- Overwhelmingly Positive

RYD date created : 2024-11-23T22:55:41.208054Z
See in json
Tags
Connections
Nyo connections found on the description ;_; report an issue lol

28 Comments

Top Comments of this video!! :3

@miramar-103

2 weeks ago

just because it's less code to write doesn't mean its faster

38 |

@NemoFish-m4e

2 weeks ago

We can upgrade first solution using get() dict method. It return second arg if key not in dict.keys()

12 |

@AlperKaplan

2 weeks ago

I’ve been asked questions like this, where I had to count items in a list, during both phone screen and onsite interviews for Amazon. They didn’t allow me to use Counter, but they did let me use defaultdict. :)

13 |

@brutusunix

2 weeks ago

So much code abstraction so much more memory usage. Just decode it yourself.

6 |

@RobertLugg

2 weeks ago

How is his solution any faster? O compute complexity seems the same.

6 |

@rodrigomorales5841

2 weeks ago

This actually simplifies a lot of leetcode problems where one needs a counter object

7 |

@DrDeuteron

5 days ago

I can do fewer lines:
>>>get_counter = Counter
though I messed up the default value, so maybe not.

|

@RusulColee

2 weeks ago

aitutorialmaker AI fixes this. Python Counter Defaultdict Dictionary overview

22 |

@pieordie7

2 weeks ago

what if you want to filter out numbers and special characters?

|

@hodayfa000h

2 weeks ago

We love dicts

1 |

@tutex119

2 weeks ago

from collections import Counter

count = Counter('aba')

print(count)

4 |

@ADailyNerd

2 weeks ago

What’s wrong with doing: length = len(string)

|

@Temporalus

1 week ago

it would be way more useful to learn how defaultdict or counter optimizes this pattern instead of just learning that there's a magic word to do it for you

|

@Forien

2 weeks ago

imagine thinking lines of code = speed...

|

@hello_there79

2 weeks ago

Progression should be like,

1. if in counter: ....
2. counter[c] = counter.get(c, 0) + 1 # Missing this
3. counter[c]: defaultdict(int) += 1
4. counter = Counter(s)

3 |

@lordmushroom723

34 minutes ago

dude wtf am i watching, who even cares just write the code to do the job, both these examples are fine lol

|

@736939

2 weeks ago

counter[item] = 1 + counter.get(item, 0)

4 |

Go To Top