idk how companies expect me to do this shit is under 30 min. Thank you though.... I've been trying to understand this all day and this is the video that made it click
Thank you so much for this amazing video!!! I really appreciate 🙏 It does really help me understand this problem clearly. Please do more videos like this!
I’m 95% there. But I’m stuck with this case: 1201. I am thinking only 1 valid decode could be made of this correct? Like 1 | 20 | 1 But I am having hard time understand how the code deals with this
Case 1: take one digit --> 1 Case 2: take two digits --> 12 In case 2, the next digit will be a 0 which is invalid so this does not count. In case 1, you move along to 2 and repeat as below: Case 1: take one digit --> 2 Case 2: take two digits --> 20 In case 1, the next digit is a 0 which is invalid so this does not count. In case 2, you move along to 1 and repeat as below: Case 1: take one digit --> 1 Case 2: take two digits --> reached end of string You must take case 1. The next index will be out of bounds and you are done. Your DP array will look like [1 1 1 1 1], i.e. you can only take one path to get to the end, no addition occurs (or in recursive terms you get a linear path where each possible alternative path leads to a dead end i.e. a leaf)
Single person on TH-cam who explained why we are using i-1 + i-2 rest of all are just telling the solution
idk how companies expect me to do this shit is under 30 min. Thank you though.... I've been trying to understand this all day and this is the video that made it click
insane explanation. i can you tell you truly understand the problem and is not just a regurgitation of a working LC solution found online... thanks!
FINALLY get it. Only video where it clicked. Deserves way more likes.
True I concur
Man please dont stop making these videos, the intution you give to solve the problem is amazing. Upload frequently and your channel will grow soon.
Thank you! Busy with something right now but will definitely keep uploading in a couple months.
Thank you brother. Only you explained why the i-1 + i-2 is valid.
After watching like 5 videos about this question finally there's one that i understand. amazing explantion
God level explanation.
This video and explanation is incredible. Why are there not more views??
I think but I could not understand. After watching your lucid video, I understand without thinking, thank you for your diffusive wisdom.
Thanks! Your channel certainly deserves way more attention! - So true - Good work mate...
Thank You!
First video that helped me understand the tabulation solution! Thanks a lot man.
Really thanks a lot, i have watched so many vudeos in youtube but didn't understand, but finally you given good explainatiin for this question❤️🙏
Awesome explanation, this should be LC Premium. I feel I got scam paying LC premium when reading the LC solution. Great job!
Finally I understood the solution, tried many videos but this one is best;
Man, what an explanation. you are AMAZING! Thank you
this video is kickass!!
Very clear explanation!
Best explanation I've found, thank you so much
Amazing explanation that will be forever useful. Thank you
thank you! i finally understood the dp subproblems
Thank you so much for this amazing video!!! I really appreciate 🙏 It does really help me understand this problem clearly. Please do more videos like this!
how is dp[0] = 1?
I have watched a number of tutorials for this one, understood your approach only. Though wrote my implementation of it and it seems a bit different.
so good, thank you :)
Amazingly explained
Great video!!! Could you please recommend some books or study material ?
Amazing explanation ! Thank you :)
Great Channel. Keep Going !
wow this was such a good explanation, thank you
Good explanation ! Keep it up
Thank you so much! finally got it!
I’m 95% there. But I’m stuck with this case: 1201. I am thinking only 1 valid decode could be made of this correct? Like 1 | 20 | 1
But I am having hard time understand how the code deals with this
Case 1: take one digit --> 1
Case 2: take two digits --> 12
In case 2, the next digit will be a 0 which is invalid so this does not count.
In case 1, you move along to 2 and repeat as below:
Case 1: take one digit --> 2
Case 2: take two digits --> 20
In case 1, the next digit is a 0 which is invalid so this does not count.
In case 2, you move along to 1 and repeat as below:
Case 1: take one digit --> 1
Case 2: take two digits --> reached end of string
You must take case 1. The next index will be out of bounds and you are done.
Your DP array will look like [1 1 1 1 1], i.e. you can only take one path to get to the end, no addition occurs (or in recursive terms you get a linear path where each possible alternative path leads to a dead end i.e. a leaf)
excellent
thanks for the great video!
Thanks!
finally bless u mann!!!!
how do i get the O(1) space complexity solution?
if you just keep dpi-1 and dpi-2 in two variables, don't need the rest beyond those
thanks for your clean explainations. though this solution does not work for input = "2611055971756562"
yup although its quite an easy fix:-
let num10to19Range = previousNum == 1 && currentNum
what if i-1==0 ex 12160012 what happens
The answer for this particular case should be 0.