House Robber - Leetcode 198 - Dynamic Programming (Python)

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ย. 2024

ความคิดเห็น • 31

  • @GregHogg
    @GregHogg  หลายเดือนก่อน

    Master Data Structures & Algorithms For FREE at AlgoMap.io!

  • @calebghirmai6478
    @calebghirmai6478 หลายเดือนก่อน +2

    Big thanks for taking the time to make this video! You broke down the concepts of DP in a helpful way :)

    • @GregHogg
      @GregHogg  27 วันที่ผ่านมา

      Glad to hear it!

  • @Azyrys
    @Azyrys 3 หลายเดือนก่อน +2

    You're amazing at explaining things :D Big thanks for the content.

  • @denizmetzger7410
    @denizmetzger7410 3 หลายเดือนก่อน +1

    ... as always... impressive and absolutely well explained! 💪🏻👍🏻

    • @GregHogg
      @GregHogg  3 หลายเดือนก่อน

      Awesome, very glad to hear it :)

  • @SHIHJUIheh
    @SHIHJUIheh หลายเดือนก่อน

    So impressive! Thanks for providing multiple solutions for DP

    • @GregHogg
      @GregHogg  27 วันที่ผ่านมา

      You're welcome 🙂🙂

  • @nathanxie1194
    @nathanxie1194 2 หลายเดือนก่อน +1

    this was such a good explanaition but im still lost lmfao

    • @lakh040
      @lakh040 15 วันที่ผ่านมา

      same

  • @christianjt7018
    @christianjt7018 27 วันที่ผ่านมา

    Nice to see both the Top down and Bottom up solutions.
    I think bottom up solution is more intuitive in this case.

    • @GregHogg
      @GregHogg  27 วันที่ผ่านมา

      I think so too :)

  • @xingyuxiang1637
    @xingyuxiang1637 3 หลายเดือนก่อน

    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  3 หลายเดือนก่อน

      We start from n-1 in the top down solution and start from 0 in the bottom up solution

  • @NikerB
    @NikerB 3 หลายเดือนก่อน

    Great explantation, how long have you been coding?

    • @GregHogg
      @GregHogg  3 หลายเดือนก่อน

      Thank you! Several years

  • @shakilahmed4647
    @shakilahmed4647 3 หลายเดือนก่อน

    Impressive Greg!

    • @GregHogg
      @GregHogg  3 หลายเดือนก่อน

      Thank you!

  • @rajendrabrahmbhatt2585
    @rajendrabrahmbhatt2585 3 หลายเดือนก่อน

    Which software are you using to draw the solution ? Is this OneNote?

    • @GregHogg
      @GregHogg  3 หลายเดือนก่อน

      Miro

  • @user-tt7po9td3x
    @user-tt7po9td3x หลายเดือนก่อน +1

    Dude you made it complicated 😅. It’s an easy problem

  • @codewithtm544
    @codewithtm544 3 หลายเดือนก่อน

    I want to learn dsa in python so how can I start please guide me

    • @GregHogg
      @GregHogg  3 หลายเดือนก่อน

      I have a full playlist of problem solutions

  • @legobuildingsrewiew7538
    @legobuildingsrewiew7538 3 หลายเดือนก่อน

    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 27 วันที่ผ่านมา

      yes, this algorithm still works, try it.

  • @rajgarimella626
    @rajgarimella626 3 หลายเดือนก่อน

    Why can’t you just take the max of the sum of the even and odd indices?

    • @mortsaidmort
      @mortsaidmort 3 หลายเดือนก่อน +1

      Because skipping two houses can be good, a la [10, 5, 5, 10] where 20 is the best score

  • @yashpokar
    @yashpokar 16 วันที่ผ่านมา

    Line number 8-11 is unnecessary.
    Your explanation 🫡🫡🫡

  • @jakewood1942
    @jakewood1942 3 หลายเดือนก่อน

    Please tell me freshman computer science will be this interesting 😅

    • @TuanNguyen-ed9rb
      @TuanNguyen-ed9rb 27 วันที่ผ่านมา

      yep, more interesting than this lol. Sometimes it's so interesting, you just want to smash your computer

  • @a4addel
    @a4addel 8 วันที่ผ่านมา

    By looking to all these comments it seems like im the only one who didn't understand