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

preview_player
Показать описание
#leetcode #hacker #datastructures #python #dynamogaming

00:00 Question Description
02:09 Explanation
17:17 Working Example
21:43 Coding
Рекомендации по теме
Комментарии
Автор

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

ybybybbo
Автор

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

MartinSteinausErding
Автор

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

HaroonRashid
Автор

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.

travmm
Автор

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

TarasSlipets
Автор

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

catskytw
Автор

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.

letticonionepic
Автор

Very gorgeous and lucid! Thanks for saving time!

Po-YuJuan
Автор

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

xialei
Автор

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

juanghpx
Автор

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

debochando
Автор

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

tny
Автор

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

pandukasenevirathna
Автор

Hey Lulu, thanks for the explain.

I didnt get why we are recursing the *width - the width* of each blocks in minute 7:36

xavierk
Автор

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

dongyoonkim
Автор

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

YosvanyBlanco
Автор

Hello Lulu. I want thank you for your thorough solution to this problem. I found it very helpful. However I don't quite understand why need to put mod (7 + 10**9) everywhere in the code, as opposed to just putting it at the end. In testing it I found that it causes the problem to be solved in time, but I do not understand why. Otherwise, thanks for the help.

nathanarkin
Автор

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?

astroswell
Автор

why we are doing modulo for all element of the array and not only the last element?

MayankGupta-fivb
Автор

omg you actually taught me😂, thanks a lot

ethans
visit shbcf.ru