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

Поділитися
Вставка
  • Опубліковано 26 вер 2024

КОМЕНТАРІ • 31

  • @ybybyb8bo592
    @ybybyb8bo592 Рік тому +5

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

  • @TarasSlipets
    @TarasSlipets 9 місяців тому +2

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

  • @HaroonRashid72
    @HaroonRashid72 8 місяців тому +3

    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 6 місяців тому +1

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

  • @juanghpx
    @juanghpx 5 місяців тому +1

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

  • @Po-YuJuan
    @Po-YuJuan 8 місяців тому +1

    Very gorgeous and lucid! Thanks for saving time!

  • @xialei3219
    @xialei3219 7 місяців тому

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

  • @pandukasenevirathna9593
    @pandukasenevirathna9593 9 місяців тому +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.

  • @andrewmagdy5470
    @andrewmagdy5470 3 місяці тому

    Thank you
    This was good explanation

  • @dongyoonkim1211
    @dongyoonkim1211 8 місяців тому

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

  • @letticonionepic
    @letticonionepic 11 місяців тому +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 7 місяців тому

      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.

  • @YosvanyBlanco
    @YosvanyBlanco 11 місяців тому

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

  • @nguyenngoctuan7149
    @nguyenngoctuan7149 8 місяців тому

    many thanks for your video

  • @catskytw
    @catskytw 3 місяці тому

    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

  • @MartinSteinausErding
    @MartinSteinausErding 5 місяців тому +2

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

  • @juanc94128
    @juanc94128 8 місяців тому

    Thank you very much, I was stucked

  • @ethans2536
    @ethans2536 9 місяців тому

    omg you actually taught me😂, thanks a lot

  • @xavierk99
    @xavierk99 7 місяців тому

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

  • @EstherLi-0509
    @EstherLi-0509 6 місяців тому

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

    • @CodeCode-pz6oo
      @CodeCode-pz6oo  6 місяців тому

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

  • @astroswell
    @astroswell 11 місяців тому +1

    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  11 місяців тому +1

      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.

  • @t0ny360
    @t0ny360 7 місяців тому

    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