Design HashSet | Leet code 705 | Theory explained + Python code | August Leet code challenge

preview_player
Показать описание
This video is a solution to Leet code 705, Design HashSet. I first explain what a Hash set is and how we could solve this question then I implement the solution using Python code.

Comment below if you have a better solution to this problem!

Let me know if you have any feedback and don't forget to subscribe for more videos!

More leetcode questions solved:

Gear used:
Рекомендации по теме
Комментарии
Автор

I believe sets shouldn't have elements repeating, those checks have not been done while inserting.

aditisurvase
Автор

Wow, nothing can be compared to your explanation, really helpful. Thank you!

abdifatahmoh
Автор

For your add you need to check if it contains. What if we add duplicate values

rockmanvnx
Автор

I thought, if you already have 2 in the set, adding another 2 will ignore it. but this algorithm will add another 2 anyway.

smart
Автор

Great explanation, man. Simple and straightforward.

kylehammerberg
Автор

Awesome buddy... Keep up your good job.. You are educating so many people...

praneeth
Автор

Wonderful explanation! You are literally the best!!!

buildwithcarolina
Автор

thank u so much, it really helped a lot

yhgong
Автор

Awesome video bro, well explained, because of you today i learned something.

jeevansch.
Автор

Easy to understand, thank you. But I'm just wondering that the hashset should be with unique elelment?

lingyuhu
Автор

Amazing explanation, thanks for this :)

yunaf
Автор

Really understood the concept, thanks!

ogoubah
Автор

Shouldnt you initialize your table as something like [ [ None ] for i in range(self.size) ] as you are appending incase of a collision because the individual elements are not of class list? what do you think?

pythonenthusiast
Автор

Great vid! However, none of these functions actually give O(1) time complexity like a built-in hashset. Do you have any other alternatives?

tl