[ HackerRank ] LegoBlocks | Dynamic Programming | Python | Visual Explanation

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

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

  • @ybybyb8bo592
    @ybybyb8bo592 ปีที่แล้ว +6

    28:11 total = 0,1,8,32(should be 64)

  • @MartinSteinausErding
    @MartinSteinausErding 8 หลายเดือนก่อน +3

    Finally someone who describes the algorithm behind the solution. This is very well done.

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

    This talk is the best, because you spend most of the time on the math. For so many of us, coding is easy and combinatorics is hard, yet this is the only talk I found that explains the math. Thank you so much.

  • @HaroonRashid72
    @HaroonRashid72 11 หลายเดือนก่อน +4

    Thank you. May you be blessed. I wanted logical help and it was the best resource. Rest of the internet had code.

  • @josh-997
    @josh-997 9 หลายเดือนก่อน +1

    感谢分享,很清晰易懂的解释!

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

    Great explanation: well-structured, concise, with a practical walkthrough.
    Many thanks!

    • @CodeCode-pz6oo
      @CodeCode-pz6oo  11 หลายเดือนก่อน

      You're very welcome!

  • @Po-YuJuan
    @Po-YuJuan 10 หลายเดือนก่อน +1

    Very gorgeous and lucid! Thanks for saving time!

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

    Awesome solution and eloborated explanation, thanks for clarifying this problem!

  • @letticonionepic
    @letticonionepic ปีที่แล้ว +2

    To those who are wondering: We counted (1, 3) combo as 4 but (3, 1) as 1 cuz if we break 3 in (3, 1) it will break into (1, 2, 1) and (2, 1, 1) which can already be covered by previous considerations from (2, 2) and (1, 3) so to avoid overlapping it has been done so.

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

      Imo your comment is misleading from the pattern of thought in the video.
      When making 4, it is true that:
      2,2 breaks to 112, 211, 1111 (which would be 4 possibilites)
      and
      3,1 breaks to 211, 121, 1111 (which would also be 4 possibilities)
      but in the explanation she didn't go through all the possible breaks, since she said we keep the first block in tact, and only look for possibilites with the rest of the blocks. You can see she marks the part that needs to be broken down with small diagonal lines.
      if the first block is a 1, we have 3, 21, 21 and 111, which is 4 possibilities
      if the first block is a 3, we only have 1 option left for the second block: 1. Thats why it is only 1 there.

  • @juanghpx
    @juanghpx 7 หลายเดือนก่อน +1

    Great explanation, helped me understand this difficult problem. Thanks for the effort you put into this video.

  • @pandukasenevirathna9593
    @pandukasenevirathna9593 ปีที่แล้ว +1

    great explanation. Thanks a lot. This is a harder question.

  • @debochando
    @debochando ปีที่แล้ว +1

    I am trying to solve this problem right now. Your video came in the right moment. Thank you so much.

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

    Thank you so much for this explanation. It really helped.

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

    Thank you
    This was good explanation

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

    f[0] is 1 which means there is only one way to build fp[0]: "no block". Thus you can just manually caculate f[0]~f[3] and f[4]=f[0]+f[1]+f[2]+f[3]=8

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

    many thanks for your video

  • @YosvanyBlanco
    @YosvanyBlanco ปีที่แล้ว

    You did a great job explaining the intuition on this one thank you!

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

    Hey Lulu, thanks for the explain.
    I didnt get why we are recursing the *width - the width* of each blocks in minute 7:36

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

    omg you actually taught me😂, thanks a lot

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

    Thank you very much, I was stucked

  • @astroswell
    @astroswell ปีที่แล้ว +2

    Thanks for the solution, Lulu! Could you please explain why is the total of ways to have a split in the wall is a multiplication of number of ways to build left-i and right-i?

    • @CodeCode-pz6oo
      @CodeCode-pz6oo  ปีที่แล้ว +2

      You can draw on a paper with hight = 1 and width of 4. When the i == 2, left side has 2 ways and right side also 2 ways, so the total is 2 *2.

  • @EstherLi-0509
    @EstherLi-0509 9 หลายเดือนก่อน

    Lulu did you come up with this solution independently? Such a genius

    • @CodeCode-pz6oo
      @CodeCode-pz6oo  9 หลายเดือนก่อน

      No, I did reference to the official solution in Hackerrank. Yet, still needs lots of effort from my side to really understand the solution.

  • @t0ny360
    @t0ny360 10 หลายเดือนก่อน +1

    In the first step when calculating the number of ways you can build a single wall layer of length 6, why do we add the four previous ones? I don't understnad that part