House Robber - Leetcode 198 - Dynamic Programming (Python)

  Рет қаралды 6,551

Greg Hogg

Greg Hogg

Күн бұрын

Пікірлер: 42
@GregHogg
@GregHogg 3 ай бұрын
Master Data Structures & Algorithms For FREE at AlgoMap.io!
@wanzhaocheng8973
@wanzhaocheng8973 Ай бұрын
love how you showed all three approaches in the code! really helped me understand the essence of DP solution
@balaganesh3440
@balaganesh3440 24 күн бұрын
That was the most simplest break down of this problem! Cant thank you enough!
@Mamuuh
@Mamuuh Ай бұрын
This is the best explanation I’ve seen. So much clearer now, thank you!
@calebghirmai6478
@calebghirmai6478 3 ай бұрын
Big thanks for taking the time to make this video! You broke down the concepts of DP in a helpful way :)
@GregHogg
@GregHogg 3 ай бұрын
Glad to hear it!
@krishhhhh3677
@krishhhhh3677 10 күн бұрын
Great way to explain Dp🎉
@christianjt7018
@christianjt7018 3 ай бұрын
Nice to see both the Top down and Bottom up solutions. I think bottom up solution is more intuitive in this case.
@GregHogg
@GregHogg 3 ай бұрын
I think so too :)
@shaunakchaudhary2178
@shaunakchaudhary2178 22 күн бұрын
One quick question. I got really confused on which value do we select exactly. How do we decide on which value to start with initially?
@SHIHJUIheh
@SHIHJUIheh 3 ай бұрын
So impressive! Thanks for providing multiple solutions for DP
@GregHogg
@GregHogg 3 ай бұрын
You're welcome 🙂🙂
@Azyrys
@Azyrys 5 ай бұрын
You're amazing at explaining things :D Big thanks for the content.
@trh786fed
@trh786fed 2 ай бұрын
By looking to all these comments it seems like im the only one who didn't understand
@AdityaGupta-wz9di
@AdityaGupta-wz9di 15 күн бұрын
your explanation is soooo good damn you explained it in such an easy way thanks
@mairahmed6196
@mairahmed6196 Ай бұрын
Man I was having such a hard time figuring this out Thank you so much for this video man
@GregHogg
@GregHogg Ай бұрын
You're very welcome!
@denizmetzger7410
@denizmetzger7410 5 ай бұрын
... as always... impressive and absolutely well explained! 💪🏻👍🏻
@GregHogg
@GregHogg 5 ай бұрын
Awesome, very glad to hear it :)
@insoucyant
@insoucyant 29 күн бұрын
Thank You!
@NikerB
@NikerB 5 ай бұрын
Great explantation, how long have you been coding?
@GregHogg
@GregHogg 5 ай бұрын
Thank you! Several years
@rajendrabrahmbhatt2585
@rajendrabrahmbhatt2585 5 ай бұрын
Which software are you using to draw the solution ? Is this OneNote?
@GregHogg
@GregHogg 5 ай бұрын
Miro
@xingyuxiang1637
@xingyuxiang1637 5 ай бұрын
You can start from index 0, and for each associated element, select and unselect. If selected, move 2 steps. If unselected, move to the next step. In this way, you do not need to reverse or start from n - 1.
@GregHogg
@GregHogg 5 ай бұрын
We start from n-1 in the top down solution and start from 0 in the bottom up solution
@nathanxie1194
@nathanxie1194 4 ай бұрын
this was such a good explanaition but im still lost lmfao
@lakh040
@lakh040 2 ай бұрын
same
@shakilahmed4647
@shakilahmed4647 5 ай бұрын
Impressive Greg!
@GregHogg
@GregHogg 5 ай бұрын
Thank you!
@codewithtm544
@codewithtm544 5 ай бұрын
I want to learn dsa in python so how can I start please guide me
@GregHogg
@GregHogg 5 ай бұрын
I have a full playlist of problem solutions
@Fam-m4i
@Fam-m4i 3 ай бұрын
Dude you made it complicated 😅. It’s an easy problem
@yashpokar
@yashpokar 2 ай бұрын
Line number 8-11 is unnecessary. Your explanation 🫡🫡🫡
@AnnShi-c1v
@AnnShi-c1v 18 күн бұрын
tysm omg
@rajgarimella626
@rajgarimella626 5 ай бұрын
Why can’t you just take the max of the sum of the even and odd indices?
@mortsaidmort
@mortsaidmort 5 ай бұрын
Because skipping two houses can be good, a la [10, 5, 5, 10] where 20 is the best score
@jakewood1942
@jakewood1942 5 ай бұрын
Please tell me freshman computer science will be this interesting 😅
@TuanNguyen-ed9rb
@TuanNguyen-ed9rb 3 ай бұрын
yep, more interesting than this lol. Sometimes it's so interesting, you just want to smash your computer
@kubs1162
@kubs1162 11 күн бұрын
If you’re asking it probably wont
@legobuildingsrewiew7538
@legobuildingsrewiew7538 5 ай бұрын
What about cases where the end of the array had something like 100 or another array where skipping two houses would be optimal? This algorithm doesnt seem to work here right?
@christianjt7018
@christianjt7018 3 ай бұрын
yes, this algorithm still works, try it.
Unique Paths - Leetcode 62 - Dynamic Programming (Python)
13:03
Greg Hogg
Рет қаралды 3,8 М.
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 1,9 МЛН
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 17 МЛН
小路飞还不知道他把路飞给擦没有了 #路飞#海贼王
00:32
路飞与唐舞桐
Рет қаралды 79 МЛН
House Robber III - Tree - Leetcode 337
18:02
NeetCode
Рет қаралды 41 М.
Pacific Atlantic Water Flow - Leetcode 417 - Graphs (Python)
17:10
5 Signs of an Inexperienced Self-Taught Developer (and how to fix)
8:40
Coin Change - Leetcode 322 - Dynamic Programming (Python)
15:27
How Robbing Houses Can Make You Better At Dynamic Programming
18:04
Kantan Coding
Рет қаралды 4,6 М.
Koko Eating Bananas - Leetcode 875 - Binary Search (Python)
13:34
What Makes A Great Developer
27:12
ThePrimeTime
Рет қаралды 209 М.
I Solved 1583 Leetcode Questions  Here's What I Learned
20:37
ThePrimeTime
Рет қаралды 726 М.
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 1,9 МЛН