House Robber - Leetcode 198 - Dynamic Programming (Python)
ฝัง
- เผยแพร่เมื่อ 27 พ.ย. 2024
- Master Data Structures & Algorithms for FREE at AlgoMap.io/
Code solutions in Python, Java, C++ and JS for this can be found at my GitHub repo here: github.com/gah...
Complete DSA Pathway Zero to Hero: • Data Structures & Algo...
Please check my playlists for free DSA problem solutions:
• Fundamental DSA Theory
• Array & String Questions
• 2 Pointers Questions
• Sliding Window Questions
• Binary Search Questions
• Stack Questions
• Linked List Questions
• Tree Questions
• Heap Questions
• Recursive Backtracking...
• Graph Questions
• Dynamic Programming (D...
My Data Science & ML TH-cam Playlist: • Greg's Path to Become ...
Learn Python and Data Science FASTER at mlnow.ai :)
Support the content: / @greghogg
Follow me on Instagram: / greghogg5
Connect with me on LinkedIn: / greghogg
Follow me on TikTok: / greghogg5
Coursera Plus: imp.i384100.ne...
My Favorite Courses:
Data Structures & Algorithms:
UCalifornia San Diego DSA: imp.i384100.ne...
Stanford Algorithms: imp.i384100.ne...
Python Data Structures: imp.i384100.ne...
Meta Coding Interview Prep: imp.i384100.ne...
Python:
UMichigan Python for Everybody: imp.i384100.ne...
Python Mastery from MLNOW.ai: mlnow.ai/cours...
Google IT Automation w/ Python: imp.i384100.ne...
Web Dev / Full Stack:
Meta Front-End Developer: imp.i384100.ne...
IBM Full Stack Developer: imp.i384100.ne...
Meta Back-End Developer: imp.i384100.ne...
John Hopkins HTML, CSS & JS: imp.i384100.ne...
IBM DevOps: imp.i384100.ne...
Cloud Development:
AWS Fundamentals: imp.i384100.ne...
GCP Cloud Engineer: imp.i384100.ne...
Microsoft Azure Fundamentals: imp.i384100.ne...
Game Development:
Michigan State Unity Development: imp.i384100.ne...
UColorado C++ for Unreal Engine: www.coursera.o...
SQL & Data Science:
SQL by MLNOW.ai: mlnow.ai/cours...
Python for Data Science by MLNOW.ai: mlnow.ai/cours...
Google Data Analytics: imp.i384100.ne...
IBM Data Science: imp.i384100.ne...
IBM Data Engineer: imp.i384100.ne...
Machine Learning & AI:
ML Mastery at MLNOW.ai: mlnow.ai/cours...
ML w/ Andrew Ng: www.coursera.o...
Deep Learning w/ Andrew Ng: imp.i384100.ne...
Master Data Structures & Algorithms For FREE at AlgoMap.io!
love how you showed all three approaches in the code! really helped me understand the essence of DP solution
That was the most simplest break down of this problem! Cant thank you enough!
Big thanks for taking the time to make this video! You broke down the concepts of DP in a helpful way :)
Glad to hear it!
This is the best explanation I’ve seen. So much clearer now, thank you!
Great way to explain Dp🎉
Nice to see both the Top down and Bottom up solutions.
I think bottom up solution is more intuitive in this case.
I think so too :)
So impressive! Thanks for providing multiple solutions for DP
You're welcome 🙂🙂
You're amazing at explaining things :D Big thanks for the content.
By looking to all these comments it seems like im the only one who didn't understand
Man I was having such a hard time figuring this out
Thank you so much for this video man
You're very welcome!
... as always... impressive and absolutely well explained! 💪🏻👍🏻
Awesome, very glad to hear it :)
your explanation is soooo good damn you explained it in such an easy way thanks
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?
Thank You!
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.
We start from n-1 in the top down solution and start from 0 in the bottom up solution
Impressive Greg!
Thank you!
Dude you made it complicated 😅. It’s an easy problem
Great explantation, how long have you been coding?
Thank you! Several years
this was such a good explanaition but im still lost lmfao
same
tysm omg
Which software are you using to draw the solution ? Is this OneNote?
Miro
Line number 8-11 is unnecessary.
Your explanation 🫡🫡🫡
I want to learn dsa in python so how can I start please guide me
I have a full playlist of problem solutions
Why can’t you just take the max of the sum of the even and odd indices?
Because skipping two houses can be good, a la [10, 5, 5, 10] where 20 is the best score
Please tell me freshman computer science will be this interesting 😅
yep, more interesting than this lol. Sometimes it's so interesting, you just want to smash your computer
If you’re asking it probably wont
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?
yes, this algorithm still works, try it.