HashMaps in Python Tutorial - Data Structures for Coding Interviews

preview_player
Показать описание
Data structures are one of the most important things to prepare for coding interviews. HashMaps are one of the most essential data structures to know, and today we'll be learning how they work, what their benefits are, and solving a practice problem together using Python.

📘 Chapters
0:00 - Intro
0:43 - Explaining HashMaps
6:47 - Example Coding Problem

🔗 Resources

🎵 Music
Brontosaurus - Dylan Sitts
Deadlines - Dylan Sitts
Pick Up Your Phone Please - baegel
Slapperoni Pizza - Jobii

#coding #softwareengineer #python
Рекомендации по теме
Комментарии
Автор

Great stuff! Super underrated channel (but not for long i bet =) )

NeetCode
Автор

After 4 days of struggling, this video finally gave me the breakthrough to understand hash maps in my self taught journey. Concise and coherent, this is the best tutorial video I've seen so far!

samm
Автор

The video was great! However, if you use the SORT method, the best time complexity you would get is O(nlogn).

If you want to solve it in O(n), a clever approach is to first check every word and create a key value pair of every letter.

For example, you go through the first word and get 3 'a', 2 't' and 4 'e'. Now you save this in a dict { 'a':3, ' t':2, 'e':4 }. Then, you go through every other word and do the same. If you find any other word with 3 'a', 2 't' and 4 'e', you have found an anagram.

So just comparing the dicts at the end would give you the anagrams. You would go through the list only once so you have time complexity O(n).

P.S. you should first check if two words are the same length. If not, you can automatically cancel them as anagrams.

drstrangeluv
Автор

Not even half way through this video and I just want to give props to how concise the information is. I hope to see some machine learning content soon :)

kaiser
Автор

Brother I literally saw 8 videos about hashmap and was always getting confused at one part or the other. Your video literally is a goldmine. Thanks for adding an example problem helps a lot!

saideep
Автор

I am just starting to study DSA by myself and this video was EXACTLY what I needed. You explained it so well that I thought the leetcode problem was EASY. Great

fabriziomarchetti
Автор

this is first video, but i'm already excitement about learn next algoritm in this series. The best.

bogdan
Автор

Great video. It’s hard to strike the balance between keeping things concise while also exploring them fully, but you did an incredible job of it here.

realbutters
Автор

I love the fact you go through an actual problem at the end. That made it “click” for me. New sub here, please keep it coming!

DevoutJourney
Автор

great hash map explaination, plus it have leetcode example and explaination for the answer in detail at the end of the video which is really great.

futhedude
Автор

I watched this video like 3 times over a month ago, and I was struggling with understanding the logic even though you tried so hard to explain it. Now, after some practice, I watched this video once again and I can say I understand the code perfectly now. I just wrote the code before seeing the solution. Thank you for yours videos, one of the best channels out there!

panwilku
Автор

your way of explaining was way good and felt like easiest question.

siddharthasankarray
Автор

Great video. After I watched your video, I tried to code it myself without looking and tried to do it without defaultdict(), just adding my first val as a list and then appending to the list for the following ones. After I had done that, I converted it to be like yours. Besides the obvious benefits, something else I realized was doing it your way removed the need to check if a key was already in the dictionary. In my version, I had to make that check, otherwise, I would be attempting to append to a list that hadn't been created yet.

misslaurenbecca
Автор

The explanation on this was so clear. Absolutely brilliant. You have gained a new subscriber and I can't wait to see this channel grow the way it deserves to!

sidandhawa
Автор

This is what should be ranked #1 when searching for "python hashmap"

BAMBAMBAMBAMBAMval
Автор

currently taking DSA, nice explanation and pacing. thanks so much dude

johnsonw
Автор

city_map = {}
cities = ["Calgary", "Vancouver", "Toronto"]
city_map["Canada"]= cities
# This works so much better

auzee
Автор

So, ive been programming in python for a little over a year, and i've always seen those hashmap memes, and how they're the solution to everything, but the name Hashmap just seems intimidating, so i never bothered thinking about using one or looking up what it is...until this day, when i realized its just a dictionary, and I've been using them all the time lol Great video, keep it up!

InDaHoops
Автор

Underrated quality channel,
note:- [add more interaction in video(llike use pencil or notepad for raw explain ), cause people like interaction.]

PrasadPatil-eglo
Автор

Seriously man, i could see your hard work through this video.

spiritual