DP 30. Minimum Insertions/Deletions to Convert String A to String B

  Рет қаралды 119,254

take U forward

take U forward

Күн бұрын

Пікірлер: 376
@kushalchakraborty6970
@kushalchakraborty6970 2 жыл бұрын
Moral of the story : DP on strings = learn LCS by heart ,❤️ Kudos to your efforts
@vikaskumarnitrr
@vikaskumarnitrr 2 жыл бұрын
yes bro
@DeepSingh-zs2oi
@DeepSingh-zs2oi 2 жыл бұрын
definitely bro
@udaypratapsingh8923
@udaypratapsingh8923 2 жыл бұрын
specially the *tabulation* part :
@shreyasnagabhushan4918
@shreyasnagabhushan4918 2 жыл бұрын
exactly , foundation for all DP problems on strings
@arteevraina6334
@arteevraina6334 2 жыл бұрын
This quote needs to be printed in notes. 🙏
@shridharsarraf2188
@shridharsarraf2188 2 жыл бұрын
that feeling of self-improvement when you don't even watch the whole video, and just in between i thought of the solution and wrote it by my own. Amazingly explained striver bhaiya
@theresilientpianist7114
@theresilientpianist7114 5 ай бұрын
us moment bro.❤❤
@tanmaisaichennagiri5543
@tanmaisaichennagiri5543 4 ай бұрын
Us bro us 🥹
@nagasrikuncharapu3736
@nagasrikuncharapu3736 10 ай бұрын
was able to solve it without watching the video , but still watched it incase I miss anything important. Thanks a lot
@chitranshjain5075
@chitranshjain5075 2 жыл бұрын
Woah! LCS proved to be a really important topic and thanks to you, I've understood it very clearly!
@amitkulkarni9682
@amitkulkarni9682 8 ай бұрын
Solved this after watching 1:49 minutes. There is no better person for DSA than Striver. Huge respect to you 💯
@__ngl__
@__ngl__ 6 ай бұрын
Funny story: I got this question during an interview for a startup and I had no idea it was a dp question, i just did simple hashing for both strings and compared and the interviewer said it wouldn't work but didn't seem to know in what case exactly. He couldn't prove it, so we ran it on their system and they must have had weak test cases because the code came as 100% correct and the interviewer was super impressed and told me that I had taught him a new way to solve the question and I legit got in. I didn't accept because I had one other option but still. (Hashing for this question is completely wrong btw, for anyone wondering, it ignores a very important part of the question which is the order of the letters. You can try the leetcode question and do hashing, you'll see it runs about 900 testcases and fails the rest)
@johncenakiwi
@johncenakiwi 2 жыл бұрын
I saw the length of the video and got the hint to solve it with the ongoing pattern (LCS). Coded in under 3 minutes!! Thanks Striver. I think I am really building the intuition for DP problems. I have been with the series from the beginning and I can proudly say that I can solve every single problem in this series till now with ease. I prefer solving using Recursion+Memo but I am also able to write the Tabulation solution for most of the problems. Thanks a tonne brother!!
@aniketghosh2001
@aniketghosh2001 2 жыл бұрын
I read your comment, got motivated, paused the video and thought for a bit, and I also solved the problem all by myself without watching the complete video, now I'm also developing confidence in solving DP problems ^_^
@arpitrajput6424
@arpitrajput6424 2 жыл бұрын
Same in my case , i also saw the length of video then i understand it must be solved by LCS then i solved it without watching the video😃😃
@analyticswithjaspreet
@analyticswithjaspreet 2 жыл бұрын
btw writing till memo during interview will not work ? means test cases surely gonna fail ? @Rishabh
@Harshit126
@Harshit126 2 жыл бұрын
Understood, thanks for making these things like "halwa". At the same time huge respect for the amount of hardwork you must have put in to come up with these amazing (easy) logical explanations! Cheers to you buddy!
@kalpeshpatil6283
@kalpeshpatil6283 2 жыл бұрын
You are always providing awesome content for any level of coder noob to pro can easily understood the concept and logic.Thank you sir.
@user-of5qt4yn5j
@user-of5qt4yn5j 2 ай бұрын
I am delighted to share that I successfully solved this problem on my own today, without needing to refer to any algorithm. I am truly grateful for all your efforts, Striver, in helping us along the way
@AppaniMadhavi
@AppaniMadhavi 6 ай бұрын
I Solved without watching, thank you so much striver for providing this wonderful content.
@dhruvdangi8923
@dhruvdangi8923 Ай бұрын
what an amazing job u did teaching us dp in the most beautiful way
@shrikantsahu7115
@shrikantsahu7115 2 жыл бұрын
Thanks a lot Striver, I always wondered how to solve DP questions, but now I am able to solve and think on my own!!
@ganeshkamath89
@ganeshkamath89 2 жыл бұрын
Thanks Striver. Understood. I don't know if this intuition will occur to candidates in a real interview.
@utkarshsingh2747
@utkarshsingh2747 Жыл бұрын
Your previous video gave a thought of using the earlier concept as an application for other questions, just few changes & boom! ❤Your content is just awesome!(Topic - LCS & it's Application XD...!)😆
@KrishnaGuptaTech
@KrishnaGuptaTech 13 күн бұрын
I did this problem as well on my own, its just learn LCS and boom. Magic happens. Thanks u striver understood !
@himanshuagrawal8012
@himanshuagrawal8012 2 жыл бұрын
Amazing solution...I wrote tabulated code without watching the solution...Thank you, LCS and Striver💝💝 #UNDERSTOOD
@ProbuddhaSingha-c7r
@ProbuddhaSingha-c7r 8 ай бұрын
Without even seeing the whole video I got the logic and solved it in leetcode in one go. All thanks to striver. You are GOD of DSA.
@DeepakVerma-iitbhu
@DeepakVerma-iitbhu 2 жыл бұрын
This is the first DP on strings question I did by myself ❤️ Thank you so much Striver 🙇🙏
@studygainer5482
@studygainer5482 7 ай бұрын
osssm yaaar striver sir love u khud se dp solution hone lga h ab
@acid..9245
@acid..9245 25 күн бұрын
Yes understood bhaiya...Thank you...
@sangeetasharma8574
@sangeetasharma8574 Жыл бұрын
typing understood has become a formality , cause we r already getting ideas to solve DP problems. Thanks striver.
@shubhankar_naik
@shubhankar_naik Жыл бұрын
First time I solved a question without looking at your approach thanks for making LCS easy
@stylish37
@stylish37 5 ай бұрын
Thanks a lot sir! I used to dread such questions, now I am really enjoying solving 'em.
@lakshsinghania
@lakshsinghania Жыл бұрын
the intuition just striked by it self without watching the video thnx striver!
@nilimsankarbora5911
@nilimsankarbora5911 Жыл бұрын
Mind blowing before watching the video i was able to do this becuz i have watched all the previous videos and i have understood very well this is insane and thank you striver.❤❤❤❤
@rishabhshairy972
@rishabhshairy972 4 ай бұрын
Solved even before watching this video. LCS is key ❤❤
@ratinderpalsingh5909
@ratinderpalsingh5909 2 жыл бұрын
Understood, sir. Thank you very much.
@anujrathore5726
@anujrathore5726 5 ай бұрын
DID THIS QUE BY MYSELF , THANK YOU STRIVER
@anshumaan1024
@anshumaan1024 Жыл бұрын
same question @leetcode - "Delete Operation for Two Strings"
@sidforreal
@sidforreal 2 жыл бұрын
You should also put "Edit path" in title since its popular with that name. Will help in YT recommendation.
@puneetsharma7117
@puneetsharma7117 2 жыл бұрын
This is not Edit Distance problem but very similar to it. You can replace characters in Edit distance whereas only deletion and insertion is possible is this one.
@Himanshhhhxu
@Himanshhhhxu 3 ай бұрын
Hard label dekh ke hamesa fatt jati thi, now solved this problem without watching the video❤ thanks to you
@YashveerGahlot-t6b
@YashveerGahlot-t6b 4 ай бұрын
sir !! your approches are so good and optimal thank you sir!!
@nimmalavishnu3044
@nimmalavishnu3044 2 жыл бұрын
Understood Raj bro...such a easy and nice explaination
@DevashishJose
@DevashishJose 11 ай бұрын
Understood, thank you so so much, solved it on my own completely
@ranasauravsingh
@ranasauravsingh 2 жыл бұрын
UNDERSTOOD... !!! Thanks striver for the video... :)
@yashsomani3042
@yashsomani3042 2 жыл бұрын
Understood, Thank You so much!!
@harshal018
@harshal018 Жыл бұрын
Best Playlist on DP
@saitejakura
@saitejakura 2 жыл бұрын
mind blowing before watching the video i was able to do this becuz i have watched all the previous videos and i have understood very well this is insane and thank you striver.
@csec0565
@csec0565 10 ай бұрын
Adding to this : Delete Operation for Two Strings will also be the same solution❤.
@santanu29
@santanu29 Жыл бұрын
I figured it out on my own. Your videos are awesome.
@amishasahu1586
@amishasahu1586 2 жыл бұрын
Amazing sir!! Understood. You are awesome!!
@xavier4107
@xavier4107 Жыл бұрын
We can do this with hashing also... Time complexity is O(S1 length + s2 length). No recursion...
@Anonymous_Coder
@Anonymous_Coder Жыл бұрын
Did this problem on myself, thanks bhaiya for making such an amazing content.
@adebisisheriff159
@adebisisheriff159 11 ай бұрын
Thanks sooooooooooooooooooooooooooooooo much striver. This completely amazing!!!
@abdalla4425
@abdalla4425 Жыл бұрын
Understood, had to take a day off yesterday because of LC contest and was a little tired of nonstop dp haha! Back on the dp so full throttle
@ntgrn-pr5yx
@ntgrn-pr5yx Ай бұрын
UNDERSTOOD , THANK YOU STRIVER
@rishabhgupta9846
@rishabhgupta9846 2 жыл бұрын
understood,solved by myself.If we closely analyse the test cases we know it is n+m-2*LCS
@jonathanjones6657
@jonathanjones6657 2 жыл бұрын
You’re strong.
@arpnasjs9825
@arpnasjs9825 Жыл бұрын
Solved before watcing...All thanks to u bhaiya....#UNDERSTOOD!
@soumybisht
@soumybisht 8 ай бұрын
it was quite similar to the previous question, solved it in just 5min :)
@harshitjaiswal9439
@harshitjaiswal9439 Жыл бұрын
Understood Striver! Thank you for such fantastic explanation!
@hashcodez757
@hashcodez757 4 ай бұрын
"UNDERSTOOD BHAIYA!!"
@Coder-zz1tn
@Coder-zz1tn 8 ай бұрын
"THANKS BRO FOR KEEPING IT SHORT"
@prabhakaran5542
@prabhakaran5542 8 ай бұрын
Understood ❤
@kevbuh
@kevbuh 4 ай бұрын
Watched every video, great series
@udatyadeb101
@udatyadeb101 Жыл бұрын
yay! did it by myself just reading the question.
@shreyasnagabhushan4918
@shreyasnagabhushan4918 2 жыл бұрын
understood bro, I didn't even realise that so many questions could be solved by just knowing LCS .
@lakshaysharma6550
@lakshaysharma6550 2 жыл бұрын
UNDERSTOOD!!!🔥🔥🔥🔥🔥🔥
@codewithom11
@codewithom11 Жыл бұрын
Previous two questions in dp series, solved by myself . Yup 😎😎
@meetsoni1938
@meetsoni1938 2 жыл бұрын
Amazing 🤩😄 . Indescribable 💯💯🚀
@aparna5364
@aparna5364 2 жыл бұрын
if we are given different costs for insertions ,deletions and replace operations.Does anyone know how to minimise the cost to convert one string to another
@paracetamol9116
@paracetamol9116 5 ай бұрын
yeah, instead of doing "1 + helper()" in recursive relations, return "cost + helper()"
@chanchalroy3417
@chanchalroy3417 11 ай бұрын
Without watching this, I was able to solve. 🙌
@vipulchaudhary_js
@vipulchaudhary_js 2 жыл бұрын
solved without watching video, Thank You so much Striver bhaiya
@apoorvyadav3378
@apoorvyadav3378 2 жыл бұрын
thank you bhaiya for this amaing series
@sagarmittal8627
@sagarmittal8627 2 жыл бұрын
LCS is amazing !!!
@cminor9037
@cminor9037 Жыл бұрын
at 2:00 i was able to create logic that answer would be just no of character except the number of character in lcs "US"
@utkarshsingh245
@utkarshsingh245 Жыл бұрын
video starts at 3:30
@meme_eternity
@meme_eternity Жыл бұрын
Solved it just by listening to question OP Striver ❤
@GopalKumar-py2cf
@GopalKumar-py2cf Жыл бұрын
this is the 1st question I solved lcs of string
@Hrushi_2000
@Hrushi_2000 Жыл бұрын
Understood. Thankyou Sir
@ishangujarathi10
@ishangujarathi10 Жыл бұрын
Understood Completely!!!
@warriorgaming9509
@warriorgaming9509 Жыл бұрын
Amazing Series Bhaiya Loving it :))))))))
@yeswanthh5068
@yeswanthh5068 2 жыл бұрын
Understood 🙂🙂💚
@HimanshuGupta-ni3pk
@HimanshuGupta-ni3pk Жыл бұрын
I love you man for making dp so easy 😂
@UECAshutoshKumar
@UECAshutoshKumar 6 ай бұрын
Thank You Understood!!!
@sumitgupta310
@sumitgupta310 6 ай бұрын
LCS is King !!
@ronakslibrary8635
@ronakslibrary8635 Жыл бұрын
US You r teaching is OP
@kumarpurushottam632
@kumarpurushottam632 Жыл бұрын
Understood Thank You Striver 😇
@fmkhandwala39
@fmkhandwala39 2 жыл бұрын
str.size()+ptr.size()-2*lcs(str,ptr)
@gangsta_coder_12
@gangsta_coder_12 2 жыл бұрын
Understood 💯💯💯
@aakashagarwal146
@aakashagarwal146 2 жыл бұрын
Solved it on my own thanks to striver #UNDERSTOOD
@durgeshsingh1089
@durgeshsingh1089 2 жыл бұрын
Can anyone tell me what should we do if the question ask for "REPLACE" , "DELETE" and "INSERT"??
@softwarefoodiee
@softwarefoodiee Жыл бұрын
There is nothing to replace actually here because if it exists in both the strings then it will be considered in the longest common subsequence.
@andrewcenteno3462
@andrewcenteno3462 4 ай бұрын
This was incredible. I don't understand the theory behind why it works( how you know this is the min there is probably a proof somewhere). But I guess you don't need too for some probrlems.
@radharamamohanakunnattur3035
@radharamamohanakunnattur3035 2 жыл бұрын
Understood!! awesome explanations!!
@SumitSharma-do2uc
@SumitSharma-do2uc 2 жыл бұрын
shi m ye subsequence or palidrome k question m kr para hun? ......bachpan m to inke nam se hi dar lgta tha
@kathanvakharia
@kathanvakharia Жыл бұрын
Understood...Completed 30/56
@naveen_kotha
@naveen_kotha 2 жыл бұрын
Understood🔥🔥
@adityasai550
@adityasai550 2 жыл бұрын
aagutalevugaaaa annaaaaaa
@rakeshakkannagari7559
@rakeshakkannagari7559 2 жыл бұрын
aaaaaaaah
@adityasai550
@adityasai550 2 жыл бұрын
@@rakeshakkannagari7559 nuvvem takkuva kaadu
@rakeshakkannagari7559
@rakeshakkannagari7559 2 жыл бұрын
@@adityasai550 neekanna chaaala takuvva anna
@adityasai550
@adityasai550 2 жыл бұрын
@@rakeshakkannagari7559 boooo👎
@AquaRegia-i3u
@AquaRegia-i3u Жыл бұрын
Quick Tip:💡If the question is modified that you can only delete or only insert, then also the solution will be same.
@mohammedraqeeb4392
@mohammedraqeeb4392 2 жыл бұрын
understood bhaiya
@rishabhagarwal8049
@rishabhagarwal8049 2 жыл бұрын
Understood sir , thank you very much
@divyachopra2369
@divyachopra2369 2 жыл бұрын
What if question says maje str1=str2 or str2=str1 like what if modifications were allowed in both the strings
@KAAO-rb9lh
@KAAO-rb9lh 4 ай бұрын
great playlist
@parthsalat
@parthsalat 2 жыл бұрын
Understood kaka!
@sachinmishra9181
@sachinmishra9181 2 жыл бұрын
Understood...😊
@vaishnavithakur6460
@vaishnavithakur6460 2 жыл бұрын
Understood!!!!
@amansamal8233
@amansamal8233 2 жыл бұрын
understood❤❤
@tikshavarshney213
@tikshavarshney213 2 жыл бұрын
Understood !
@aravindrooswelt4734
@aravindrooswelt4734 4 ай бұрын
How will be this if replacement also allowed??
@ujjalsaha428
@ujjalsaha428 2 жыл бұрын
Al always "understood"
DP 31. Shortest Common Supersequence | DP on Strings
26:44
take U forward
Рет қаралды 173 М.
DP 32. Distinct Subsequences | 1D Array Optimisation Technique 🔥
40:15
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
DP 29. Minimum Insertions to Make String Palindrome
12:00
take U forward
Рет қаралды 169 М.
DP 56. Count Square Submatrices with All Ones | DP on Rectangles 🔥
15:59
DP 50. Minimum Cost to Cut the Stick
30:02
take U forward
Рет қаралды 148 М.
DP 33. Edit Distance | Recursive to 1D Array Optimised Solution 🔥
37:39
DP 23. Unbounded Knapsack | 1-D Array Space Optimised Approach
22:54
take U forward
Рет қаралды 130 М.
DP 43. Longest Increasing Subsequence | Binary Search | Intuition
16:27
DP 51. Burst Balloons | Partition DP | Interactive G-Meet Session Update
34:00
DP 22. Coin Change 2 | Infinite Supply Problems  | DP on Subsequences
22:17
Why Your Brain Sabotages Your Goals (and How to Fix It)
11:56
Productive Peter
Рет қаралды 26 М.