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

  Рет қаралды 279,250

Back To Back SWE

Back To Back SWE

5 жыл бұрын

Free 5-Day Mini-Course: backtobackswe.com
Try Our Full Platform: backtobackswe.com/pricing
📹 Intuitive Video Explanations
🏃 Run Code As You Learn
💾 Save Progress
❓New Unseen Questions
🔎 Get All Solutions
Question: Write a program that takes two strings and computes the minimum number of edits needed to transform the first string into the second string.
Examples:
Input: "Saturday" and "Sundays"
Output: 4
Why:
In: "Saturday"
1.) Delete the first 'a' ("Sturday")
2.) Delete the first 't' ("Surday")
3.) Replace 'r' with 'n' ("Sunday")
4.) Insert an 's' at the end ("Sundays")
Out: "Sundays"
Our 3 Operations To Fix Character Mismatch:
- Insert
- Delete
- Replacement
++++++++++++++++++++++++++++++++++++++++++++++++++
HackerRank: / @hackerrankofficial
Tuschar Roy: / tusharroy2525
GeeksForGeeks: / @geeksforgeeksvideos
Jarvis Johnson: / vsympathyv
Success In Tech: / @successintech
++++++++++++++++++++++++++++++++++++++++++++++++++
This question is number 17.2 in "Elements of Programming Interviews" by Adnan Aziz, Tsung-Hsien Lee, and Amit Prakash.

Пікірлер: 959
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
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 4 жыл бұрын
@@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 2 жыл бұрын
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 4 жыл бұрын
Dynamic programming is sick to understand..but when you do it is the best feeling..!! Thanks for a great explanation..!!♥️
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@diegocastro7434
@diegocastro7434 3 жыл бұрын
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.
@thelilnatey
@thelilnatey 4 жыл бұрын
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 4 жыл бұрын
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
@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
@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
@hussammostafa
@hussammostafa 4 жыл бұрын
Man! You're brilliant! I'm doing my masters now and this is the best explanation i've seen so far! Thanks
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@chiranjeevipippalla
@chiranjeevipippalla 3 жыл бұрын
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 🙏🏻
@chetansahu1505
@chetansahu1505 4 жыл бұрын
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 4 жыл бұрын
yo
@bugontheice
@bugontheice 3 жыл бұрын
I just wish that this awesome video had subtitles/captions, for the hard of hearing people like us :(
@anujapuranik2000
@anujapuranik2000 5 жыл бұрын
Great explanation. It is definitely a difficult problem and you made it so easy to understand. Thanks!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@cwash08
@cwash08 4 жыл бұрын
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 4 жыл бұрын
nice!
@joshkariyathu8902
@joshkariyathu8902 2 жыл бұрын
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!!
@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.
@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
@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
@blatanthamma6624
@blatanthamma6624 3 жыл бұрын
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
@chetansahu1505
@chetansahu1505 4 жыл бұрын
You are the godfather of all mentors bro. :)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
yo
@dderudito
@dderudito 4 жыл бұрын
You are a really good teacher. I've got it this time!!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@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
@monikshamurthy2466
@monikshamurthy2466 3 жыл бұрын
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 3 жыл бұрын
ok
@victorliafook
@victorliafook 4 жыл бұрын
The best explanation for this problem I've seen so far. Thank you
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hey
@victorliafook
@victorliafook 4 жыл бұрын
Sup
@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
@deepakdas4513
@deepakdas4513 4 жыл бұрын
I have never seen a better explanation to this "The Levenshtein Distance" problem. Just awesome.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@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.
@ujjwaldeswal1924
@ujjwaldeswal1924 4 жыл бұрын
I can't believe. one of the finest explanation I got. Nice job bro. Impressive buddy ^^
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@bodang2425
@bodang2425 5 жыл бұрын
Thanks a lot! Crystal clear and impressive!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks
@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
@southern-sunshine
@southern-sunshine 4 жыл бұрын
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 4 жыл бұрын
nice!
@AshishShukla-ro8oy
@AshishShukla-ro8oy 4 жыл бұрын
You are "GOD" best teacher on youtube so far...
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
haha
@SzechSauce
@SzechSauce 4 жыл бұрын
Thank you so much for this brilliant explanation!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@b9944236
@b9944236 Жыл бұрын
The smaller table is so useful to understand, what an amazing teacher !
@looklook6075
@looklook6075 2 ай бұрын
i can not express how much you have helped me to understand dynamic programming.
@0x1h0b
@0x1h0b 4 жыл бұрын
"it's not about the pattern , it's about the sub problems" ... i think i just lost my innocence ...best
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
lol
@gabrielraphaelgarciamontoy1269
@gabrielraphaelgarciamontoy1269 5 жыл бұрын
This was amazing! Thank you! Subscribed and liked :) You should do one with the stone problem or maze part II
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
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.
@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
@surajlalgupta6536
@surajlalgupta6536 4 жыл бұрын
Man, you are the best. Amazed to see how easily you explain such complex topics.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@darshitgandhi9122
@darshitgandhi9122 4 жыл бұрын
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 4 жыл бұрын
I'm not sure, I did this a while back
@darshitgandhi9122
@darshitgandhi9122 4 жыл бұрын
@@BackToBackSWE okay sir...np... And thank you so much for uploading all these videos...it has helped me a lot😀🙌🏻
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
@@darshitgandhi9122 ye
@12nites
@12nites 4 жыл бұрын
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 4 жыл бұрын
@@12nites my b, if I messed up, I don't remember
@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"?
@ramachandragopalposina3943
@ramachandragopalposina3943 3 жыл бұрын
Man you are amazing probably the best explanation anyone can give ✌️✌️. You make dynamic programming and backtracking problems look much more simpler than they actually are 😌....awesome 👏. I just love your stuff 😍
@user-ov5nd1fb7s
@user-ov5nd1fb7s 3 жыл бұрын
These videos are wonderful. Both beginners and experienced people can get something out of them.
@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 4 жыл бұрын
Back To Back SWE which textbook if I may ask?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
@@SzechSauce Kleinberg & Tardos: Algorithm Design - dry but fire
@SzechSauce
@SzechSauce 4 жыл бұрын
Back To Back SWE Thanks will have a look!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
@@SzechSauce ye
@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 )
@sgerodes
@sgerodes 3 жыл бұрын
This explanation is magic. Thank you for explaining the meaning of operations of the algo.
@williamhenry7226
@williamhenry7226 2 жыл бұрын
I have been trying to get my brain around the "distance value" for Levenstein during an NLP project. This was great! Thanks.
@venkydaggubati9375
@venkydaggubati9375 4 жыл бұрын
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 4 жыл бұрын
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 4 жыл бұрын
thanks for this, old video, remaking one day
@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 3 жыл бұрын
I agree. That's how C++ substring operation work too.
@MohsenKhamis-xk8yl
@MohsenKhamis-xk8yl Жыл бұрын
bro
@AnandKumar-pz1pi
@AnandKumar-pz1pi 2 жыл бұрын
Best explanation. The ease with which you explained this "one of the toughest" question simply amazed me. I was really able to visualize everything as you went through. I am already a fan of yours :)
@Ayoub-adventures
@Ayoub-adventures 3 жыл бұрын
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 3 жыл бұрын
yeah
@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.
@kumarprateek1279
@kumarprateek1279 5 жыл бұрын
One of the best explanation so far for any dynamic programming problem!!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks
@kingelvisalive
@kingelvisalive 2 жыл бұрын
The grid helped me to visualize, the repetitive explanation helps to confirm understanding. I understand this now. Thank you very much.
@VarunVermaUSC
@VarunVermaUSC 4 жыл бұрын
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 4 жыл бұрын
Ok, let me go back in time a few months and redo this one, brb
@kueen3032
@kueen3032 4 жыл бұрын
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 4 жыл бұрын
@@kueen3032 hey
@kueen3032
@kueen3032 4 жыл бұрын
@@BackToBackSWE hi ! What are you upto these days? Any new internship or are you giving all of your time in teaching programming?
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
@@kueen3032 We'll see
@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
@isaiahvictor6773
@isaiahvictor6773 2 жыл бұрын
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.
@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 !!!!!
@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.
@shivanathmahalingam3466
@shivanathmahalingam3466 3 жыл бұрын
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 3 жыл бұрын
hey
@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
@lucacesarano3588
@lucacesarano3588 2 жыл бұрын
Best explanation so far. I'm amazed by your communication technique.
@LaksithaRanasingha
@LaksithaRanasingha 5 жыл бұрын
This is a brilliant explanation man. Thanks so much. I understood this much better than when my lecturer taught the same. Your teaching style is the key, keep it up.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
aw 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.
@darshansimha2166
@darshansimha2166 2 жыл бұрын
Beautiful explanation. Stopped watching at 8:20 and solved it myself. Thank you for this.
@mercuriallabs9
@mercuriallabs9 4 жыл бұрын
Well said! its not about pattern its about sub problems. One of the best explanation on youtube...
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@srikanthtumpudi536
@srikanthtumpudi536 4 жыл бұрын
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 4 жыл бұрын
haha, nice, thx
@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.
@SR-we1vl
@SR-we1vl 4 жыл бұрын
Far than obvious, this man is a legend indeed!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
I am normal
@vinayakbiju
@vinayakbiju 12 күн бұрын
I was initially confused midway, but going through the whole video cleared all my doubts. Thanks a lot
@TharaMesseroux1
@TharaMesseroux1 2 жыл бұрын
Thank you so much! I appreciate you taking the time to explain this concept so well!
@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
@TimHinnerkHeuer
@TimHinnerkHeuer 3 жыл бұрын
Wow amazing explanations! Really help to understand the bottom up dynamic programming paradigm. I had a good grasp on dp with recursion but always struggle with bottom up a bit. This explanation really helps. Thanks so much!
@hakanklc4327
@hakanklc4327 2 жыл бұрын
OMG! You're amazing sir. This was the best explanation I've ever seen.
@pradeep6295
@pradeep6295 5 жыл бұрын
I am finally getting the hang of DP after watching your videos, thanks a lot !
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice, keep it up
@Pickyricky69420
@Pickyricky69420 3 жыл бұрын
Wow. There is so much to unpack! I am watching this one few hundred times. Good job Benyam!!!
@sudhanshusharma9123
@sudhanshusharma9123 3 жыл бұрын
Thank you so much!! I was having a very hard time understanding bottom up approach for this one. Also, thank you for the motivation in the starting by telling your struggle to understand the same question.
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
sure
@itzboyon6983
@itzboyon6983 Жыл бұрын
Respect, dude. You deserve a ton of respect for how you taught us this topic.
@BackToBackSWE
@BackToBackSWE Жыл бұрын
thank you
@efenadiralumni6547
@efenadiralumni6547 4 жыл бұрын
man simply you are the best. please do not stop
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ok
@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.
@wei-chenglai6865
@wei-chenglai6865 3 жыл бұрын
This is very clear!! I have tried to understand it for a week.
@frankhu5418
@frankhu5418 4 жыл бұрын
I totally get that 0:20 section where you say slaying this is like slaying a dragon. I'm back to interviewing, and I'm pretty determined to slay the dp/levenshtein dragon myself now. I tried to understand this problem like 4-5 years ago and never got it. That replace, insert, delete, key box is amazing though! It makes understanding this much easier. Thanks again for all the videos! This one was awesome!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
haha, I forgot what I said, this video is old. Nice and thank you
@wangrobbie6867
@wangrobbie6867 3 жыл бұрын
No one explained more clearly than you on EditDitance. Thx!
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
sure!
@samgak_imbap862
@samgak_imbap862 3 жыл бұрын
I am always so slow in understanding algorithm, but I immediately understand after watching !!! The video is soooooo helpful!
@midasama3124
@midasama3124 4 жыл бұрын
These dynamic programming problems have become a major headache for me these days. Your nice explanation just made my day. I just hope I could easily identify when it would be appropriate to use this technique. Thanks for the effort.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Thanks and sure!
@Randomisticful
@Randomisticful Жыл бұрын
You are a born teacher. Wow!
@srinivasadineshparupalli5139
@srinivasadineshparupalli5139 3 жыл бұрын
Awesomeness. Explanation blown my mind. Superbly understood the topic.
@ankuragarwal4014
@ankuragarwal4014 5 жыл бұрын
Thanks a ton!! best among all the videos on youtube for this topic, really you deserve millions of subscribers
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
haha thanks
@SevenRiderAirForce
@SevenRiderAirForce 2 жыл бұрын
You are a good teacher and should feel good about that.
@veronicawong8669
@veronicawong8669 4 жыл бұрын
You are amazing! I have been reading a lot of articles and still couldn't understand it.. but you just used 16 mins and made this so clear and simple!!!! Thanks!!!!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Sure
@badblue8185
@badblue8185 2 жыл бұрын
I really appreciate your methods T-T no matter what I studied I couldn't get this, but now I can be rest assured I got it finally.
@omarshawky1290
@omarshawky1290 3 жыл бұрын
left coursera and came here to understand and I'm gonna tell you did a great job to make one like me understand this problem :D Thank you
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
great!
@MidhunDarvin625
@MidhunDarvin625 3 жыл бұрын
Great video dude! Amazing how easily you are able to explain it.
@nikitabanga1767
@nikitabanga1767 5 жыл бұрын
I have been trying to understand this problem for a very long time! Everybody taught the pattern But i wanted to know why its done. Thank you so much for explaining!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@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
@vikasrai4915
@vikasrai4915 4 жыл бұрын
Best explaination I have ever seen.Thanks, you made DP a fun to do thing.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@sainimkar815
@sainimkar815 3 жыл бұрын
Damn! This is the best explanation for edit distance problem on the entire internet. Amazing! Please make more videos
@natesouverlai4916
@natesouverlai4916 3 жыл бұрын
Hands down the best explanation of the problem.
Edit Distance - Dynamic Programming - Leetcode 72 - Python
21:00
Alex hid in the closet #shorts
00:14
Mihdens
Рет қаралды 10 МЛН
Iron Chin ✅ Isaih made this look too easy
00:13
Power Slap
Рет қаралды 30 МЛН
How do Spell Checkers work? Levenshtein Edit Distance
21:23
Minimum Edit distance (Dynamic Programming) for converting one string to another string
28:22
Vivekanand Khyade - Algorithm Every Day
Рет қаралды 144 М.
The Change Making Problem - Fewest Coins To Make Change Dynamic Programming
23:12
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 625 М.
Я купил первый в своей жизни VR! 🤯
1:00
Top 50 Amazon Prime Day 2024 Deals 🤑 (Updated Hourly!!)
12:37
The Deal Guy
Рет қаралды 1,4 МЛН
Cheapest gaming phone? 🤭 #miniphone #smartphone #iphone #fy
0:19
Pockify™
Рет қаралды 4,3 МЛН
Samsung laughing on iPhone #techbyakram
0:12
Tech by Akram
Рет қаралды 2 МЛН
Самый тонкий смартфон в мире!
0:55
Не шарю!
Рет қаралды 91 М.
Новые iPhone 16 и 16 Pro Max
0:42
Romancev768
Рет қаралды 257 М.