Coding Interview Question | Minimum Edit Distance | Dynamic Programming with Optimization
Vložit
- čas přidán 27. 07. 2024
- LeetCode Link - leetcode.com/problems/edit-di...
InterviewBit Link - www.interviewbit.com/problems...
Guys, I have made a mistake I in this video. I have forgotten to check the first case at 20:32. The character n is common in both strings. So, the value of M[5][4] will be 2 and final answer will be 3.
I am not putting down the video since I think explanation is quite clear and it was a genuine mistake. I hope it doesn't trouble you guys. Sorry about the same. Will be more careful from now on! :)
The video includes following details-
0:00-0:29 - Question with example
0:29-1:45 - Which string to convert
1:45-2:48 - Why dynamic programming
2:48-3:43 - Visualisation of dp
3:43-5:43 - Initial conditions
5:43-9:40 - Algorithm Formation
9:40-21:06 - Dry run and detailed explanation
21:06-21:43 - Take any string as source
21:43-22:00 - Complexities
22:00-22:40 - Space Optimization
Please subscribe to my channel - / keertipurswani
LinkedIn - / keertipurswani
Instagram - keerti.purs...
Great keerti, it's so fulfilling to see real corporate people joining the CZcams and sharing the knowledge, I too am a HR professional and have started a dedicated channel to help people be successful in their career.. I wish you the best dear...
The patience to almost complete the dry run, hat's off to that!
Great job! Keep posting such videos!
Wow..Wow... I have never seen anyone explains DP this clearly, I have seen many other videos but they all say take value from previous, above or diagonal cell, but nobody explained why we need to refer different cells. you are the only one who explains the usage of the previous cells.. you never miss to impress Keerti. I am going to save this video for my DP reference. Keep going
Great explanation.. before coming to this video, I saw some other videos as well.. Only your video had the complete explanation for each step. Thank you so much!
Really helped in visualizing how DP can help in solving this problem. Thanks Keerti!
The one line which you use in your videos, "I know it's not easy to understand it now.... once we take an example it will be much more clear" always encourages me to stick to it and it feels as if you know the state of your student/viewer at that point, hats off to your teaching method Keerti and thank you very much!
CRYSTAL CLEAR! Thank you :)
Nice explanation... Helps visualizing properly... Keep it up
Nice explanation!
simply great
Great Content...
great job
Good explanation 👍
Awesome content and very good in clarity of explanation. Try to reduce the background noise . i loved the content #keerthiPurswani . Cheers
Much better audio! Good job!
Thanks :)
thanks for this video. Can you please do a video to explain the coin change problem as well
best ever explanation to this problem ✌️
Thanks Sathish 😇
For the instance where n==n shouldn’t it pick up the value from diagonal up??
Hi Keerti, in the If condition it should be str1[i - 1] == str2[j - 1]
In m[5][4], n == n, m[5][4] should be set to m[5-1][4-1] = 2 instead of 3 as shown. The overall answer will hence be 3 instead of 4. Please correct it
Thank you @Code Ninja. It was an honest mistake. I missed checking the first case. I considered putting down the video since youtube doesn't allow you to edit once the video is up but since explanation was right and the mistake is only at very end - I am adding this to description. Thanks again for pointing it out! Hope this never happens again!
@@KeertiPurswani Thanks for responding in. The intent was only to help share honest feedback as this would benefit other folks learning in as well. These are amazing videos. Keep doing the good stuff! All the best ahead.
Thank you so much! It really means a lot 😊☺️
Great explanation. And please make a space optimization video!
It's already there.
Check it out - czcams.com/video/7C_FIc7PytA/video.html
Hope you like it! 😇
@@KeertiPurswani Thank you so much didi.
Hope you like it! 😇
Can you explain top down approach ?
Is it necessary to learn recursion, if without knowing recursion, can we directly jump into tabulation in dp?. If all subproblems can be solved using dp, should we need to go for recursion( except tree and graph traversals)?
nice
Mam try to use pen tab. It will more efficient than whiteboard
👍👍👍❤❤
Maam, I think in the second condition at 6:10 it should be str[i-1]==str[j-1], please correct me if I understood anything wrong. Thank You
Mam i understood it preety well but i don't get it that how would i think in this way while solving.
It will come with practise. Focus on understanding the logic and thought process 😊
I love you Keerti💞💞💞
the minimum operation will be 3
Yes, have added in the description 😊
Why do you need this matrix .. just create two array for storing the char count. Check how many add and delete operation are there. Take the maximum of two, because one delete and one add operation is basically a replace operation .. this should be the easiest explanation. 20 mins for this?