Edit Distance Between 2 Strings - The Levenshtein Distance ("Edit Distance" on LeetCode)

  Рет қаралды 297,045

Back To Back SWE

Back To Back SWE

Күн бұрын

Пікірлер: 968
@BackToBackSWE
@BackToBackSWE 6 жыл бұрын
Table of Contents: (and correcting small mistakes) My Humble Leetcode Beginnings 0:00 - 0:34 The Problem Introduction 0:34 - 1:50 The Notation We Will Use For Substrings 1:50 - 3:17 Situation 1: Equivalent Characters (Subproblem Drop-Through) 3:17 - 4:47 Situation 2: Mismatch, Do A Replacement Operation 4:47 - 6:10 Situation 3: Mismatch, Do An Insert Operation 6:10 - 7:01 Situation 4: Mismatch, Do A Delete Operation 7:01 - 7:50 Dynamic Programming Table Walkthrough (Bottom Up) 7:50 - 14:46 Time Complexity 14:46 - 15:12 Space Complexity 15:12 - 15:34 Please Validate Me 15:34 - 15:56 Mistakes In Speech: 4:57: I said "y does not match m", I meant "y does not match h". My bad. 10:28: I say "Replace has an edit distance of 0. What I mean is that if we did the replace operation we would add 1 to the edit distance between the strings " " and " " ." I was not fully clear, but what we do is add 1 to the minimum of the edit distances that result from a certain operation on the cell we are sitting on. The code for this solution is in the description. In my walkthrough, I put A's characters on the columns and B's characters on the rows. The code puts A's characters on the rows of the DP table and B's characters on the columns. Either way, that is an implementation detail, as long as you understand the operations and how they relate our substrings you should be solid to answer this question in the interview.
@katiesissons8205
@katiesissons8205 5 жыл бұрын
you're the best, thank you
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@katiesissons8205 sure
@nayemalaboni8318
@nayemalaboni8318 4 жыл бұрын
@@BackToBackSWE Thank you so much for such perfect explanation, mashallah your explanations are always so perfect and you're so passionate about it, since you are having trouble getting back to people or answering their questions maybe you can make a video addressing the questions in comments? also can you please post a new link to the solution code its not working for me
@maxxmahh
@maxxmahh 4 жыл бұрын
Very nice explanation, thank you! However, what should you do if when you have repeating characters? This algorithm doesn't work if you compare "a" to "aa", it will give you edit distance 0, while it should be 1!
@maxxmahh
@maxxmahh 4 жыл бұрын
Ok, the explanation here is not correct, as many similar once. Here is the correct solution: kzbin.info/www/bejne/jqnbYZVtmc92qNU
@Arcketer
@Arcketer 5 жыл бұрын
I'm an experienced engineer and I'm absolutely blown away by how well you are able to explain these topics. Absolutely amazing video, thank you so much.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
hahaha, aw, thanks
@edgarsanmartinjr.4278
@edgarsanmartinjr.4278 3 жыл бұрын
Perfectly explained. Love how you pointed out that it’s one thing to memorize the patterns but it’s another thing to understand what each cell means and what we are actually doing in every cell
@prakad97
@prakad97 5 жыл бұрын
Dynamic programming is sick to understand..but when you do it is the best feeling..!! Thanks for a great explanation..!!♥️
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@bhushanshinde8358
@bhushanshinde8358 4 жыл бұрын
I am experienced professional currently working for HP n I am totally amazed by the understanding of the topics and especially the amount of dedication u put in to convey the same to others. That's a unique talent to have..all the best for the future! Keep making videos. Happy coding.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Thanks
@thelilnatey
@thelilnatey 5 жыл бұрын
Yo I had a kind of rocky grasp on minimum edit distance until I watched this video. This is exactly how I needed it explained to me
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice
@wen-tseshao321
@wen-tseshao321 4 жыл бұрын
Every SWE going to have an interview must to know this channel, this is the most clear DP explanation video I've ever seen!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ye - for the gram
@chetansahu1505
@chetansahu1505 5 жыл бұрын
You explain so bit by bit that you leave no stone unturned. Nobody can ask you doubt it is that precisely explained. Keep up the work bro. Hats off.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
yo
@tsehousung3552
@tsehousung3552 4 жыл бұрын
This is by far the best explaination I've ever seen about this topic, so clear and elegant. Thanks a lot.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure.
@b9944236
@b9944236 Жыл бұрын
The smaller table is so useful to understand, what an amazing teacher !
@diegocastro7434
@diegocastro7434 4 жыл бұрын
Hey man, just wanted to say I really, really appreciate you making these videos, they are clean, concise and better than literally any others out there. I've gone through most of your videos and I can honestly say that I have learned more from you than from any professor I have ever had.
@deepakdas4513
@deepakdas4513 4 жыл бұрын
I have never seen a better explanation to this "The Levenshtein Distance" problem. Just awesome.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@duncduncan3719
@duncduncan3719 3 жыл бұрын
i really like that you go through literally every step of the process, even if it means saying the exact same sentence five times in a row haha
@siliconvalley-z4j
@siliconvalley-z4j 2 жыл бұрын
Really good explanation, and accent is very friendly for the foreign, expression is very clear
@hussammostafa
@hussammostafa 5 жыл бұрын
Man! You're brilliant! I'm doing my masters now and this is the best explanation i've seen so far! Thanks
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks
@willw4096
@willw4096 2 жыл бұрын
7:54 "DP tables are not about remembering numbers. It's not about remembering patterns of how you fill it out. It's about knowing what is going on, why we do it this way, and what the sub-problems are." Very nicely said. I feel that.
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Thanks! subscribe to our 5 day free mini course for some cool content backtobackswe.com/
@kumarprateek1279
@kumarprateek1279 5 жыл бұрын
One of the best explanation so far for any dynamic programming problem!!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks
@chetansahu1505
@chetansahu1505 5 жыл бұрын
You are the godfather of all mentors bro. :)
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
yo
@wanderer.1993
@wanderer.1993 4 жыл бұрын
dude...best teacher ever! FANTASTIC
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@bugontheice
@bugontheice 3 жыл бұрын
I just wish that this awesome video had subtitles/captions, for the hard of hearing people like us :(
@surajlalgupta6536
@surajlalgupta6536 4 жыл бұрын
Man, you are the best. Amazed to see how easily you explain such complex topics.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@anujapuranik2000
@anujapuranik2000 5 жыл бұрын
Great explanation. It is definitely a difficult problem and you made it so easy to understand. Thanks!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@shivanathmahalingam3466
@shivanathmahalingam3466 4 жыл бұрын
This is so beautiful now thanks to your wonderful explanation. I don't comment often on KZbin but this video truly deserves it.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hey
@dderudito
@dderudito 5 жыл бұрын
You are a really good teacher. I've got it this time!!!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice
@srikanthtumpudi536
@srikanthtumpudi536 5 жыл бұрын
The Way your explaination , the way you built the requirements to solve problem extremely helpful. I habituated to browse for your videos when a problem is ambiguous and if I need any basic knowledge about that problem . My teacher suggested to watch your videos and follow your way of thinking a problem and solving. Thanks for decreasing speed while explaining :)
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
haha, nice, thx
@ujjwaldeswal1924
@ujjwaldeswal1924 4 жыл бұрын
I can't believe. one of the finest explanation I got. Nice job bro. Impressive buddy ^^
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@mushymush223
@mushymush223 3 жыл бұрын
I'm so glad this video exists. Currently taking the algorithmic toolbox course on coursera, and the lectures on the topic are horrendous. Some of the worst lectures I have ever seen in my entire academic life. And then there is this guy who actually seems to enjoy teaching and puts effort into it.
@SzechSauce
@SzechSauce 5 жыл бұрын
Thank you so much for this brilliant explanation!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@looklook6075
@looklook6075 7 ай бұрын
i can not express how much you have helped me to understand dynamic programming.
@0x1h0b
@0x1h0b 5 жыл бұрын
"it's not about the pattern , it's about the sub problems" ... i think i just lost my innocence ...best
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
lol
@darshansimha2166
@darshansimha2166 2 жыл бұрын
Beautiful explanation. Stopped watching at 8:20 and solved it myself. Thank you for this.
@arunkumar-vw1lk
@arunkumar-vw1lk 4 жыл бұрын
I was really puzzled how this pattern matching works. Even though i know the code i couldn't understand what it does. But this video gave a clear explanation.Excellent job, keep rocking.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Ye
@kingelvisalive
@kingelvisalive 3 жыл бұрын
The grid helped me to visualize, the repetitive explanation helps to confirm understanding. I understand this now. Thank you very much.
@badal1985
@badal1985 5 жыл бұрын
Your videos are really really good. Thanks for the good work!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Thanks for taking the time to watch them. -Ben
@wangrobbie6867
@wangrobbie6867 4 жыл бұрын
No one explained more clearly than you on EditDitance. Thx!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure!
@Ashish.Shukla9
@Ashish.Shukla9 5 жыл бұрын
You are "GOD" best teacher on youtube so far...
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
haha
@mercuriallabs9
@mercuriallabs9 4 жыл бұрын
Well said! its not about pattern its about sub problems. One of the best explanation on youtube...
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@bodang2425
@bodang2425 5 жыл бұрын
Thanks a lot! Crystal clear and impressive!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks
@efenadiralumni6547
@efenadiralumni6547 5 жыл бұрын
man simply you are the best. please do not stop
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
ok
@venkydaggubati9375
@venkydaggubati9375 5 жыл бұрын
Thanks for the great explanation. I have a question though, in the "Our key" table below, should insert and delete swap places, since we are transforming A to B? 9:00 - 9:48 in the video, or am I confused?
@4sky
@4sky 5 жыл бұрын
In the video it is correct, but why the key is set up that way is not explained very well. It took me a long time to grasp it after many hours of looking at it. Let's say we have to transform "benyam" to "e". (Please look at the chart in the video for reference.) "" b e n y a m "" r i e d * "e"? We have to INESRT "e" into the empty string. If we go diagonal to the replace cell, we transform the "benya" part of "benyam" into "" and we just get "m". Then how do we turn "m" into "e"? We have to REPLACE "m" with "e". If we go left to the delete cell, we transform the "benya" part of "benyam" into "e" and we just get "em". Then how do we turn "em" to "e"? We have to DELETE "m" to get "e"
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks for this, old video, remaking one day
@southern-sunshine
@southern-sunshine 5 жыл бұрын
This is the first video which properly taught me the logic. I clearly understood difference between insert and replace which was always so confusing to me. I have seen many videos just going through formula without rational behind it. Thanks a ton again
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice!
@darshitgandhi9122
@darshitgandhi9122 5 жыл бұрын
Sir actually in the key part while solving the table , the places of replace is ok, but the insert and delete places shouldn't be interchanged??
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
I'm not sure, I did this a while back
@darshitgandhi9122
@darshitgandhi9122 5 жыл бұрын
@@BackToBackSWE okay sir...np... And thank you so much for uploading all these videos...it has helped me a lot😀🙌🏻
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@darshitgandhi9122 ye
@12nites
@12nites 5 жыл бұрын
Yess, thanks for posting this, I thought I was going crazy. The easiest way to see it is during the pre-filling of the table (base cases) at 8:55
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@12nites my b, if I messed up, I don't remember
@bassantgamal8873
@bassantgamal8873 4 жыл бұрын
you are amazing, I spent two days trying to understand this problem before finding this video, I understood it in 15 minutes only, that is awesome. I do really like how deeply you are able to explain that.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@captainlennyjapan27
@captainlennyjapan27 5 жыл бұрын
Thank you for the video but I need help! 4:42 Why does it become A[0,3] -> B[0,2] , and not A[0,3] -> B[0,3] ?? I don't understand why we are comparing 4 char string to 3 char string all of a sudden
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
So what we are doing is a subproblem decomposition and seeing how each action causes a new subproblem to be birthed. For A[0,3] -> B[0,2] aka "beny" to "eph", if we do a replacement to repair the last character mismatch, then the new subproblem is both strings without that character (because we are going to replace the last character to "repair" the first string). The new subproblem (or problem left to solve) is "ben" to "ep", this is our new task to transform and compute the edit distance of. 1 plus "ben" -> "ep" is the answer to the edit distance if we choose to replace from the state "beny" -> "eph". That 1 represents theoretically doing the action. The code explains each well: github.com/bephrem1/backtobackswe/blob/master/Dynamic%20Programming%2C%20Recursion%2C%20%26%20Backtracking/editDistance.java
@captainlennyjapan27
@captainlennyjapan27 5 жыл бұрын
Ah that makes sense..! Thanks you so much!
@ahmedpatel1995
@ahmedpatel1995 5 жыл бұрын
@@BackToBackSWE Small suggestion, would recommend to cover such underlying presumptions in the video on spot
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@ahmedpatel1995 ok
@vman049
@vman049 4 жыл бұрын
​@@BackToBackSWE At 4:56, why do you say, "Y does not match M"? Did you mean "Y does not match H"?
@blatanthamma6624
@blatanthamma6624 4 жыл бұрын
I have to say there are tons of explanation for this good old question but none of them are as good as yours, it's super clear and it actually makes sense even for someone like me who's kinda new to DP
@Ayoub-adventures
@Ayoub-adventures 4 жыл бұрын
1:37 "there are brute force ways to do it, we are going to look at the dynamic programming approach" I don't like this statement a lot, I would rather deduce the DP from the brute force.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
yeah
@cwash08
@cwash08 5 жыл бұрын
I've recently understood this from watching a bunch of videos and watched this to strengthen my understanding. There are no doubt great videos since I was able to understand from them, but I have to say thank you Benyam for explaining the details of not only the algorithm, but how it relates to what we know about things like sub-problems and where the decisions in the table are coming from. Basically you don't just say what the algorithm is, you explain it. I didn't really see that from other videos, I just looked for patterns and listened very, very carefully if there was such a small explanation given (maybe like 2 seconds in the video). Basically the way I understand these problems now are that when we have problems like optimization from many combinations/permutations (min/max), it is usually exponentially brute force and we avoid talking about the recursive solution in the first place, because the sub problems allow us to use just a few of the previous values we know about by solving bottom up from the base case. Instead of using recursion and using the memoization top down approach, we can create a test case with a table (essentially an array, can be 2D) using a bottom up tabulation approach and utilize a pattern we find there for our algorithm, keeping in mind the meaning of the values we are filling in and what the rows and columns represent. In this example, (3, 2) represents the sub-problem where we solve for the substrings "ben" and "ep". For two empty ("") strings we can just return 0. We can use the table we create (provided that what what we are filling into the table is correct) and see how the sub-problems are related and how it helps us solve the current problem. To show additional information from our tabulated approach solution, we use the last value in our table (array) and work backward to find the operations when values change. For edit distance, I mean we can find what the actual edits are by working backward with our pattern where values change starting from the last value in our array. All of this typing and I have only done a couple very basic ones, so what I say can be BS or missing something. But I rather understand before doing a bunch of problems, its hard for people to explain DP I guess, which is why many give the advice to just solve a bunch of problems.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice!
@gurtagel
@gurtagel 5 жыл бұрын
The only thing that I don't get is why going left, up, or diag-up represents delete, insert and replace operations respectively. The intuition of using the minimums makes sense but this is what I can't wrap my head around.
@peterparser995
@peterparser995 5 жыл бұрын
Check the base cases (first row/column) in one case we are incrementing the amounts of deletes to arrive at "". Other case is incrementing the insertions from "" to our expected result. For the replace you compare the smaller substrings diagonally (i-1, j-1) and add 1 only if the last chars being compared are different.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
I did not make this clear but the key is that each cell is a subproblem. When we go left, up, or diag-up it changes the substrings that we take the Levenshtein distance against. The Levenshtein Distance of where we are at is the min of the Levenshtein Distance yielded from the min of the 3 operations PLUS ONE. PLUS ONE because we are choosing one of those operations and hence executing it. @Mathieu Neron is right, the base cases make things more clear and we won't know anything until we drill down to them in the top down approach which is what the code sample I provided in the description does. Just keep pondering on it and it will click. I apologize for my unclarity. Continue asking questions as the arise and challenge what you know.
@gurtagel
@gurtagel 5 жыл бұрын
@@BackToBackSWE Thanks this helped! I get it now
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@gurtagel ok cool
@FloShaban
@FloShaban 5 жыл бұрын
@@peterparser995 But the delete and insert don't make sense to me. Since we got from b to empty string by deleting, but that's considered insertion on the key? (looking at 0,0 0,1 and 1,0 )
@monikshamurthy2466
@monikshamurthy2466 4 жыл бұрын
Really like the way you take time to explain the sub problems instead of simply pointing out the pattern. Awesome explanation! 👏Keep up the good work 👍
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ok
@xxxxxjjjjj62
@xxxxxjjjjj62 4 жыл бұрын
your explanation can't be clearer. still I forget everything after my eyes are off the screen.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
it takes practice, you have to code it.
@isaiahvictor6773
@isaiahvictor6773 3 жыл бұрын
the way you teach reminds of how i teach the kids (ages 7-14) at my work how to code. Just the way you talk and go over the same things multiple times. Its so much easier to understand.
@MohamedSamy-kr6ug
@MohamedSamy-kr6ug 5 жыл бұрын
I'm impressed, how could you do this ! Go on you are awesome :D
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thx, I read a textbook haha, and the explanation is decent
@SzechSauce
@SzechSauce 5 жыл бұрын
Back To Back SWE which textbook if I may ask?
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@SzechSauce Kleinberg & Tardos: Algorithm Design - dry but fire
@SzechSauce
@SzechSauce 5 жыл бұрын
Back To Back SWE Thanks will have a look!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@SzechSauce ye
@samarthsoni6103
@samarthsoni6103 4 жыл бұрын
best ever explaination and channel to learn coding
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@gabrielraphaelgarciamontoy1269
@gabrielraphaelgarciamontoy1269 6 жыл бұрын
This was amazing! Thank you! Subscribed and liked :) You should do one with the stone problem or maze part II
@BackToBackSWE
@BackToBackSWE 6 жыл бұрын
I think that's on my list...I have like 250 questions scheduled rn so I'm pretty sure I'll hit the fundamentals you'll need. We will see.
@vinayakbiju
@vinayakbiju 5 ай бұрын
I was initially confused midway, but going through the whole video cleared all my doubts. Thanks a lot
@JamshadAhmad
@JamshadAhmad 4 жыл бұрын
1:50 Instead of making pairs of (startIndex, endIndex) I think it would have been better to make pairs like (startIndex, length) so that we don't run into negative indexes.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
That sounds reasonable - I don't remember the implementation enough to be 100% sure this works but sounds fine
@devershichandra2241
@devershichandra2241 4 жыл бұрын
I agree. That's how C++ substring operation work too.
@mimosapoon6038
@mimosapoon6038 5 жыл бұрын
You explain it very well. And I really appreciate you walked through the calculations for every single cell in the table. You save my day. Thanks
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Hahaha, ok, sure
@VarunVermaUSC
@VarunVermaUSC 5 жыл бұрын
I applaud the effort you've taken to explain the fundamentals, great solution. My 2 cents. Please try not too move too much and obstruct the view. It's a little distracting when someone is trying to focus on the board.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Ok, let me go back in time a few months and redo this one, brb
@kueen3032
@kueen3032 5 жыл бұрын
haha I was about to comment the same thing but then I thought someone might have already commented this and here you are anyway Ben, love your videos!!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@kueen3032 hey
@kueen3032
@kueen3032 5 жыл бұрын
@@BackToBackSWE hi ! What are you upto these days? Any new internship or are you giving all of your time in teaching programming?
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@kueen3032 We'll see
@itzboyon6983
@itzboyon6983 2 жыл бұрын
Respect, dude. You deserve a ton of respect for how you taught us this topic.
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
thank you
@AbinayaThiyagarajan777
@AbinayaThiyagarajan777 5 жыл бұрын
Thanks for explaning clearly. One suggestion I would like to tell is there is no pause or a break, please slow down, you to need to take a breath, and give viewers time to process the information too.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Yeah I know, I'm working on it
@santosh1809
@santosh1809 5 жыл бұрын
hahaa lol, there is pause btn man, there is a fking pause btn for some reason
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@santosh1809 hey
@santosh1809
@santosh1809 5 жыл бұрын
@@BackToBackSWE hey thanks man for contributing into open source competitive programming lessons
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@santosh1809 sure
@SR-we1vl
@SR-we1vl 4 жыл бұрын
Far than obvious, this man is a legend indeed!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
I am normal
@Madeinchinaagain
@Madeinchinaagain 4 жыл бұрын
my 2 cents: don't focus so much on how you repeat each point or operation. With the extra time you're spending on repeating each operation verbally, you could be giving the WHY or the logic behind the "transformation" or sub-transformation.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ok.
@nynom
@nynom 5 жыл бұрын
Man!! Thank you soo much. I came across this problem so many times, couldnt even understand it in my ungrad algorithms course and you just made this problem so simple and easy to understand. Thanks a bunch!!!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure haha, I thought this explanation was "ok". I did this video a while back and don't even remember how well I explained it. I have a remote feeling that it was a mid-decent explanation.
@nihargadkari5914
@nihargadkari5914 5 жыл бұрын
Awesome explanation. I looked at a lot of other videos but the way you break the problem down and outline the operations helps a lot. Please keep up the good work.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Sure, thanks
@macroxela
@macroxela 4 жыл бұрын
This is the best explanation of dynamic programming I've seen, even better than the MIT OCW. Not many people spend time on the tables which I believe are quite useful when learning.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice.
@MohsenKhamis-xk8yl
@MohsenKhamis-xk8yl Жыл бұрын
bro
@natesouverlai4916
@natesouverlai4916 3 жыл бұрын
Hands down the best explanation of the problem.
@angelicatorresgarcia5228
@angelicatorresgarcia5228 2 жыл бұрын
thank you SO much !!!!! when you said its not about the pattern something in me clicked and i just hope my brain can work like yours someday. i really appreciate the way you explain things !! thank u forever !!!!!
@Pedr0Diniz
@Pedr0Diniz 2 ай бұрын
Thank you very much for this explanation. I failed an interview that had this question and even though you said it's not about the pattern, the pattern did help me at least scrible the problem and get a feeling of it instead of being completely clueless.
@chiranjeevipippalla
@chiranjeevipippalla 4 жыл бұрын
I never ever thought I would love DP tables. The thing you said - It’s not about the patterns, it’s all about the sub problems. You stick that in my mind so hard that I started looking for sub problems. Thanks brother 🙏🏻
@SevenRiderAirForce
@SevenRiderAirForce 3 жыл бұрын
You are a good teacher and should feel good about that.
@dylanhan9577
@dylanhan9577 5 жыл бұрын
Hey, really appreciate the help. It's always nice that you took the initiative to take a step forward and help others understand this concept.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
yea
@animeshjain4045
@animeshjain4045 3 жыл бұрын
Never seen such a well explained solution....Thanks
@polybius9089
@polybius9089 Жыл бұрын
This has to be, hands down, the best and easiest to understand explanation for this subject! Thank your for this video and your work, you've earned a new subscriber! :D
@lucheeno
@lucheeno 2 жыл бұрын
Best explanation so far. I'm amazed by your communication technique.
@myhoop
@myhoop 5 жыл бұрын
Great explanation. Very intuitive. Tried to understand this on Wikipedia first, without success. This video made it clear to me.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Great. And eh....Wikipedia is pretty hard for even me to understand. They go into very DEEP depth and stay mathematical. Much more exact and informative than me, but I think the key is that one understands something before getting the full details. Thanks for watching.
@sainimkar815
@sainimkar815 3 жыл бұрын
Damn! This is the best explanation for edit distance problem on the entire internet. Amazing! Please make more videos
@mohamedessam3054
@mohamedessam3054 5 жыл бұрын
your explanation is more simple and clear than that i hear from stanford course
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
haha nice, it is alright
@hakanklc4327
@hakanklc4327 3 жыл бұрын
OMG! You're amazing sir. This was the best explanation I've ever seen.
@chengjiang7051
@chengjiang7051 5 жыл бұрын
What an excelent explannation. I could not believe i figured it out. Thanks a lot !!!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
It's an ok explanation haha, thx
@leonewu7171
@leonewu7171 3 жыл бұрын
This is the simplest turtorial I have ever seen abount edit distance in youtube
@sgerodes
@sgerodes 3 жыл бұрын
This explanation is magic. Thank you for explaining the meaning of operations of the algo.
@woodylucas
@woodylucas 4 жыл бұрын
No one mentions how you just showcased your growth. Like you stated you couldn't solve a simple problem--I don't mean to offend anyone, by saying simple, to where you are now. I love it man! It gives individuals like me confidence, because there was a time there was problems on there that were labeled easy and I couldn't solve them, and it was a real confidence drainer. Now look you're solving these dynamic programming problems w/ great conceptual overviews.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ye
@MooMooKhanThe1st
@MooMooKhanThe1st 3 жыл бұрын
First I ignored this video because there is a guy with a whiteboard and guys with whiteboards usually explain stuff not very clearly. But this is totally a different case, I understood everything. Thank you!
@micado6
@micado6 3 ай бұрын
I saw this algorithm in class and honestly couldn't follow it at all... I was hoping someone could explain it better on here, and you did!! thank you so much for this!
@Randomisticful
@Randomisticful Жыл бұрын
You are a born teacher. Wow!
@samgak_imbap862
@samgak_imbap862 4 жыл бұрын
I am always so slow in understanding algorithm, but I immediately understand after watching !!! The video is soooooo helpful!
@baldbadger7644
@baldbadger7644 4 жыл бұрын
that's was a lesson in a logical and clear manner. thanks a lot
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks and sure
@Pickyricky69420
@Pickyricky69420 3 жыл бұрын
Wow. There is so much to unpack! I am watching this one few hundred times. Good job Benyam!!!
@yueranzhang2350
@yueranzhang2350 5 жыл бұрын
most clearly edit distance explanation ever seen!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thx
@androidnexus5336
@androidnexus5336 5 жыл бұрын
Even I'm Japanese, your English is easy to understand. Your explanation is super awesome. thanks :)
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Nice, haha, I never considered that that'd be an issue when I started this channel hmm
@ankithas1868
@ankithas1868 4 жыл бұрын
You are superb bro i simply took paid course of algoexpert this is crystal clear explanation with intuition building i should have bought your course
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
We are building something exceptional in the coming year
@mihirpandey7831
@mihirpandey7831 9 ай бұрын
I was having a hard time understanding this problem.. but this lecture completely clear this concept. Thank you
@IntegralDeLinha
@IntegralDeLinha 5 ай бұрын
Thanks a lot! You made it really clearer! I couldn't see each cell as a subproblem before your video.
@mucahitalper8184
@mucahitalper8184 4 жыл бұрын
I opened 6 different tabs of videos explaining this topic, thankfully watched your video first. I'm so clear about this know thank you tons ^^
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great
@srinivasadineshparupalli5139
@srinivasadineshparupalli5139 3 жыл бұрын
Awesomeness. Explanation blown my mind. Superbly understood the topic.
@WIN_1306
@WIN_1306 2 ай бұрын
u got a new subscriber ,just keep posting such informative videos bruh
@cabutchei
@cabutchei 4 жыл бұрын
You, sir, are amazing, no need to say more!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@joshkariyathu8902
@joshkariyathu8902 3 жыл бұрын
Thanks a TON for these amazing videos. Your explanation not only helps you understand the solution rather also helps you figure out how to think and arrive at it. Love your work!!
@sarthakdhingra2168
@sarthakdhingra2168 4 жыл бұрын
Really liked how you covered all the different situations!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
The Change Making Problem - Fewest Coins To Make Change Dynamic Programming
23:12
How do Spell Checkers work? Levenshtein Edit Distance
21:23
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 18 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 9 МЛН
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 43 МЛН
Minimum Edit distance (Dynamic Programming) for converting one string to another string
28:22
Vivekanand Khyade - Algorithm Every Day
Рет қаралды 166 М.
How I Mastered Data Structures and Algorithms in 8 Weeks
15:46
Aman Manazir
Рет қаралды 126 М.
Network Flows: Max-Flow Min-Cut Theorem (& Ford-Fulkerson Algorithm)
21:56
Edit Distance - Dynamic Programming - Leetcode 72 - Python
21:00
Minimum Edit Distance Dynamic Programming
9:47
Tushar Roy - Coding Made Simple
Рет қаралды 547 М.
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 271 М.
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
The Backtracking Blueprint: The Legendary 3 Keys To Backtracking Algorithms
13:44
The Algorithm Behind Spell Checkers
13:02
b001
Рет қаралды 420 М.