House Robber 3 (LeetCode 337) | Full solution with diagrams | Dynamic Programming | Study Algorithms

SdĂ­let
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

Komentáƙe • 29

  • @user-nh8jt6cw8o
    @user-nh8jt6cw8o Pƙed 10 měsĂ­ci +3

    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.

    • @nikoo2805
      @nikoo2805 Pƙed 10 měsĂ­ci

      You are absolutely correct. Missed A at 11:54

  • @rajeshsheela26
    @rajeshsheela26 Pƙed měsĂ­cem

    Thanks, @Nikhil Lohia, for the detailed breakdown of this dynamic programming series. I appreciate your explanation!

  • @AnmolGupta-oj4lm
    @AnmolGupta-oj4lm Pƙed 5 měsĂ­ci

    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.

  • @matthewzarate8851
    @matthewzarate8851 Pƙed měsĂ­cem

    Amazing explanation and solution! Thanks Nikhil!!

  • @VM-ue6hu
    @VM-ue6hu Pƙed měsĂ­cem

    Too good ... respect man !!

  • @hareepjoshi
    @hareepjoshi Pƙed 11 měsĂ­ci +1

    This was a really good breakdown.

  • @samridhshubham8109
    @samridhshubham8109 Pƙed 4 měsĂ­ci +1

    clean and BEAUTIFUL

  • @vishnum9988
    @vishnum9988 Pƙed 2 měsĂ­ci

    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.

  • @cannguyen9044
    @cannguyen9044 Pƙed 6 měsĂ­ci

    Tks you, This was a really break down the problem and explain how to approach .

  • @user-dd7uv4it9v
    @user-dd7uv4it9v Pƙed rokem

    Thanks, this video helped me better understand the solution

  • @prashanthshetty8337
    @prashanthshetty8337 Pƙed 4 měsĂ­ci

    simplicity at its best!

  • @zhenzhang2520
    @zhenzhang2520 Pƙed 3 měsĂ­ci

    Thanks for your awesome solution, I have learned a lot via your excellent videos.

  • @nandanraj923
    @nandanraj923 Pƙed 3 měsĂ­ci

    well explanation .....

  • @khanmuhammad3021
    @khanmuhammad3021 Pƙed 11 měsĂ­ci +1

    Superb solution

  • @AnkitSingh-lq8ou
    @AnkitSingh-lq8ou Pƙed rokem +1

    Excellent sir

  • @vinaysen3351
    @vinaysen3351 Pƙed 11 měsĂ­ci

    Beautiful explanation 😊 sir ji

  • @shradhaydham4745
    @shradhaydham4745 Pƙed 3 měsĂ­ci +1

    excellent approch and explanation
    brother

  • @subee128
    @subee128 Pƙed 7 měsĂ­ci +1

    Thanks

  • @user-hw4dq7pm7w
    @user-hw4dq7pm7w Pƙed rokem

    Excellent explanation sir

    • @nikoo28
      @nikoo28  Pƙed 11 měsĂ­ci

      Thanks and welcome

  • @tarunchandravanshi5739
    @tarunchandravanshi5739 Pƙed 9 měsĂ­ci

    amazing explanation plz make some more videos on dp on trees

    • @nikoo28
      @nikoo28  Pƙed 9 měsĂ­ci

      DP: czcams.com/play/PLFdAYMIVJQHPXtFM_9mpwwQtIdzP6kxHS.html
      Trees: czcams.com/play/PLFdAYMIVJQHPswf74XJDtuWV-4BOeP65l.html

  • @ashishkumarshawhitchem2017
    @ashishkumarshawhitchem2017 Pƙed 11 měsĂ­ci

    You got a subscriber . Bhaiya thoda aur video daliye series banaiya DP ka

    • @nikoo28
      @nikoo28  Pƙed 10 měsĂ­ci

      i am constantly adding new videos every week. Appreciate your patience :)

  • @instedlar
    @instedlar Pƙed rokem

    Can you make a video to input a tree in c/c++ or any other language?

    • @nikoo28
      @nikoo28  Pƙed rokem

      what problem do you face when constructing a tree?

  • @sanjai_rs7
    @sanjai_rs7 Pƙed 7 měsĂ­ci

    Can you please the change the teaching board to dark or similar...

    • @nikoo28
      @nikoo28  Pƙed 7 měsĂ­ci

      White is good for diagrams. Will keep using white