House Robber 3 (LeetCode 337) | Full solution with diagrams | Dynamic Programming | Study Algorithms
VloĆŸit
- Äas pĆidĂĄn 26. 07. 2024
- This robber is very crazy, and this time they want to rob houses that are arranged in form of a binary tree. The condition remains same though, no two adjacent houses can be robbed. In this solution we derive a solution step by step, to determine what could be the maximum loot using dynamic programming. All along with beautiful animations and a dry-run of code in JAVA.
Actual problem on LeetCode: leetcode.com/problems/house-r...
Chapters:
00:00 - Intro
01:11 - Problem Statement and Description
03:41 - How to attack such problems
10:50 - Deriving a solution
12:53 - Dry-run of Code
16:11 - Final Thoughts
đ Links to topics I talk about in the video:
House Robber 1: âą House Robber (LeetCode...
House Robber 2: âą House Robber 2 (LeetCo...
Dynamic Programming: âą Dynamic Programming ea...
đ A text based explanation is available at: studyalgorithms.com
Code on Github: github.com/nikoo28/java-solut...
Test-cases on Github: github.com/nikoo28/java-solut...
đ Reference Books:
Starting Learn to Code: amzn.to/36pU0JO
Favorite book to understand algorithms: amzn.to/39w3YLS
Favorite book for data structures: amzn.to/3oAVBTk
Get started for interview preparation: amzn.to/39ysbkJ
đ To see more videos like this, you can show your support on: www.buymeacoffee.com/studyalg...
đ„ My Recording Gear:
Recording Light: amzn.to/3pAqh8O
Microphone: amzn.to/2MCX7qU
Recording Camera: amzn.to/3alg9Ky
Tablet to sketch and draw: amzn.to/3pM6Bi4
Surface Pen: amzn.to/3pv6tTs
Laptop to edit videos: amzn.to/2LYpMqn
đ» Get Social đ»
Follow on Facebook at: / studyalgos
Follow on Twitter at: / studyalgorithms
Follow on Tumblr at: / studyalgos
Subscribe to RSS feeds: studyalgorithms.com/feed/
Join fan mail: eepurl.com/g9Dadv
#leetcode #programming #interview
Just one small mistake The ARob should be A+Bskip+Cskip. You marked it as Bskip+Cskip. But I must say u made this question super simple to visualize.
You are absolutely correct. Missed A at 11:54
Thanks, @Nikhil Lohia, for the detailed breakdown of this dynamic programming series. I appreciate your explanation!
what a guy you are!!!! I have never studies trees before. Still I got your solution in one go... Thanks alot.. I will complete my data Structure requirement from your channel.
Amazing explanation and solution! Thanks Nikhil!!
Too good ... respect man !!
This was a really good breakdown.
clean and BEAUTIFUL
Great video Nikhil, just a request, it would have been better if you would have also included the call stack of the recursion in the dry run.
Tks you, This was a really break down the problem and explain how to approach .
Thanks, this video helped me better understand the solution
simplicity at its best!
Thanks for your awesome solution, I have learned a lot via your excellent videos.
well explanation .....
Superb solution
Excellent sir
Beautiful explanation đ sir ji
excellent approch and explanation
brother
Thanks
Excellent explanation sir
Thanks and welcome
amazing explanation plz make some more videos on dp on trees
DP: czcams.com/play/PLFdAYMIVJQHPXtFM_9mpwwQtIdzP6kxHS.html
Trees: czcams.com/play/PLFdAYMIVJQHPswf74XJDtuWV-4BOeP65l.html
You got a subscriber . Bhaiya thoda aur video daliye series banaiya DP ka
i am constantly adding new videos every week. Appreciate your patience :)
Can you make a video to input a tree in c/c++ or any other language?
what problem do you face when constructing a tree?
Can you please the change the teaching board to dark or similar...
White is good for diagrams. Will keep using white