Excellent Video. Very helpful and well explained. I do have some confusion about some DP theory. Can you please clarify if this is "Top-Down DP" or "Bottom-UP" DP approach?
So glad you liked it! The whole Top Down vs. Bottom Up terminology is something that I still find confusing (and to some extent unnecessary). However, to answer your question, my understanding of the verbiage is that problems you solve using Tabulation (i.e. what we did here) is considered a "Bottom Up" approach, whereas Memoization is considered a "Top Down" approach. That would imply that this method of solving it is a Bottom Up one :) It seems that the differences are discussed in much more depth on SO: stackoverflow.com/questions/6164629/what-is-the-difference-between-bottom-up-and-top-down
Hello, I am trying to understand basic concept here and I am newbie here. What the statement 'return dp[-1][-1]' do? In the same context in leetcode Top-Down solution what the statement 'return dp(0,0)' do?
In Python, we use -1 as an index to refer to the last item in a list. So, dp[-1][-1] returns the element in the final row and final column. dp[0][0] refers to the element in the 0th row and 0th column. I hope that helps!
Thank you so much. Appreciate the efforts you made in explaining each statement of recursive solution.
My pleasure! Super glad it helped :)
Great explanation. thanks for the video.
Nice one 😇
Thank you for thr detailed explanation
My pleasure :)
you are awesome!!
Excellent Video. Very helpful and well explained. I do have some confusion about some DP theory. Can you please clarify if this is "Top-Down DP" or "Bottom-UP" DP approach?
So glad you liked it! The whole Top Down vs. Bottom Up terminology is something that I still find confusing (and to some extent unnecessary). However, to answer your question, my understanding of the verbiage is that problems you solve using Tabulation (i.e. what we did here) is considered a "Bottom Up" approach, whereas Memoization is considered a "Top Down" approach. That would imply that this method of solving it is a Bottom Up one :)
It seems that the differences are discussed in much more depth on SO:
stackoverflow.com/questions/6164629/what-is-the-difference-between-bottom-up-and-top-down
Hello, I am trying to understand basic concept here and I am newbie here. What the statement 'return dp[-1][-1]' do? In the same context in leetcode Top-Down solution what the statement 'return dp(0,0)' do?
In Python, we use -1 as an index to refer to the last item in a list. So, dp[-1][-1] returns the element in the final row and final column. dp[0][0] refers to the element in the 0th row and 0th column. I hope that helps!
@@babybear-hq9yd Thank you very much. Yes now it's getting to me.