Dp 25. Longest Common Subsequence | Top Down | Bottom-Up | Space Optimised | DP on Strings
Vložit
- čas přidán 28. 02. 2022
- Lecture Notes/C++/Java Codes: takeuforward.org/dynamic-prog...
Problem Link: bit.ly/3pvkqUd
Pre-req for this Series: • Re 1. Introduction to ...
a
Make sure to join our telegram group for discussions: linktr.ee/takeUforward
Full Playlist: • Striver's Dynamic Prog...
In this video, we solve the LCS Dp, this is the first problem on the pattern Strings on DP.
If you have not yet checked our SDE sheet, you should definitely do it: takeuforward.org/interviews/s...
You can also get in touch with me at my social handles: linktr.ee/takeUforward
In the future, Mr. Vikramaditya will go down as the G.O.A.T online DSA teacher.
Yes he is GOAT
I am the future
He is already for me.
putting your years of hardwork in some videos ,how lucky we are,Thanks a lot striver bhaiya for everything you are doing for us
If someone is following Striver's series then this LCS is also a cakewalk..#Striver gives u confidence and you are no longer scared of dp😁
46:05 for space optimization we don't require the loop for prev as the values are already zero in it.
Understood and you've completely changed my life. Doesn't matter if I get placed in a good company or not but the quality of this lectures are supreme and I will carry this knowledge for rest of my life.
Keep trying. It will work out. Dream for the day when you are so good that you REJECT your dream company.
@@AdityaKumar-be7hx Requires god level consistency to do that.
You will probably forget the concepts, since these are never used in the industry. What a satire !
🤣🤣@@idris110
brother are you placed
Protect this guy at all costs. Thank you sir for all your hard work in making this video.
Everyone should be protected bro
understood bhaiya!!! after a very long time i am back to your channel....previously i was doing a race that as soon as you upload the video, i should watch it then n there, before the next video gets uploaded in this dp series, but due to some busy schedule, i lost the race. yeah, but your quality and energy is still the same as your starting videos
I am very grateful to you for uploading this playlist. This is great!!!!!!!!!!!!!!!!!!!!!
Understood.
15:34 "You kow i am hearing you" in the background
So?
I used to be scared of Dp when I started coding journey, but when I am actually doing it, it's cake walk. Thankyou striver for sharing your knowledge.
What an easy explanation, loved it !
bro!!!!!! What an explanation, absolutely brilliant. I am starting to love coding now. Thanks
No other video on the topic will offer you a better explanation than this! This is just pure teaching excellence! Subscribed.
You can't find better explanation than this, Brilliant!!
You're a great teacher. If possible, please do problems about DP on tree. I struggle with them. Thank you!
understood.wonderful. amazing. hats-off. unmatchable.
UNDERSTOOD.....Thank You So Much for this wonderful video............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
bro striver you have taught so well that i didnt even need to watch the video,i solved the problem in all three ways,thaank you very much❤
Understood! Awesome explanation as always, thank you very much!!!
understood, always in awe of you genius and hard working you are:)
Understood,you are doing the great job , very thankful to you
absolutely minds bogling.i am not kidding i wasn't able to solve simple recusion questions few weeks ago now i can solve medium and hard dp questions on my own without watching videos.all i can say thank you striver.
Its taking while to digest this information for me ,
Just imagine the efforts this guy is adding to make it available for everyone.
UNDERSTOOD...
Thanks striver for the video... :)
Loved the Explanation!!Understood
Thanks for great explanation striver
Dhonnobad Brother
You are great
Understood, Thank you so so much.
Thanks bro the Playlist is top notch...am getting a lot better...Thanks again
awesome, understood..was pretty easy due to what you've alrready taught
Just one word , Beautiful!
You are amazing ❤️.
Thanks a lot for this valuable content 🙌🙇🙇
Very good explanation. Understood. Thanks.
Man the content is gold.
what an explanation thanks for your time and such video
Awesome lecture. Understood!
Thank You Very much Striver !
Giving my best shot for preparing for my placements. Let's see what happens in upcoming months. Great Content
Thanks a lot striver
very good explanation
seriously you are a legit!
understood ,thanks🙌
US ❤
I should mention I am solving DSA consistently from past 1 year. Encountered this question a lot of times.
But till date this is the best explanation boss❤
very well explained step by step
hey man i know you are a very good teacher , but you are also a very good human being.
Understood boss man!
I’m just so thankful to you for this wonderful series, I’m honestly enjoying it dude, surely you’re one of the best!
I even did the problem by myself so easily, i was shocked believing😂
me too😂
awesome paaji
Thank you so much bhaiya, I always heard of this question as one of the most difficult ones. But by following your DP series, I did it on my own. You can easily sell this quality content for ₹ 50k but you're giving it for free. BEST TEACHER EVER ♥♥♥♥
Understood Sir!
Understood, sir. Thank you very much.
Understood sir ! 🙏🙏
Love the concept ✨
GOAT for a reason❤❤
Nice explanation raj bhaiyan or dude, I might call you angel!🥰🥰
Thanks Striver. Understood LCS.
understood,previously I mugged up the tabulation formula for the exam ,but now I know how it came.
Understood ❤
Great explanation!
understood !!
I deeply understand recursion, memoization, tabulation and space optimization.
Understood!
Thank you Striver for such a wonderful explanation. Finally understood it intuitively. 💯💯
thank you so much!
Understood 🤩🤩
one of the best dp series
Thank You
Understood!!!
If someone is using java to write the code, in space optimization approach there will be error in a testcase, to resolve that error replace prev = curr with prev = curr.clone(); or else use the code snippet
int [] temp = prev;
prev = (curr);
curr = temp;
Because in java prev = curr will not create a new array but it will point both the references to same address.
Your program would work fine.
In Tabulation we are declaring vector with values zero. So we can skip first two loops.
Clear and Simple
Love you bro :) you are saviour!
nice explaination !
understood well !
Understood Sir, Thank you very much
Genius!
Understood !!
Excellent explanation bro
GREAT AND INSIGHTFUL VIDEO
Again @takeUforwad, just letting you know, again that's stuff you have done, is GOD's own work, thank you for from bottom of my heart, thanks !!!
Thanks man
he is the example of beauty with brains
best dp playlist on youtube
god!!! of teaching dsa
understood
This man is saviour. Thanks bhaiya ❤️
understood bhayia❤️🙏
beautifully explained thanks a lot!!
I solved with different tabulation approach (without shifting index) as below:
int m=text1.length();
int n=text2.length();
int[][] dp = new int[m][n];
int temp=0;
for(int i=0; i
same
Striver, why can't we return INT_MIN , in the base case. Because if we return 0, it will be added to 1 and the resultant number will be considered for maximum. And even if it is not the maximum, it will be returned. Your explanation is very intuitive.
Thank you Striver 😍
did it in 1st attempt without seeing the video, shifting index to right was new to me
understood!
You are a legend!
Understood 😊
who agrees that this dp series is one of the best on CZcams
Not one of the best no. THE BESTTTTT!!!!!
love this!
simple space optimization technique : just 2,3 chanes
instead of using 2 different vectors we can just change dimension of dp to [no of previous rows we wanred + 1][no of colum]
int longestCommonSubsequence(string s1, string s2) {
vectordp(2, vector(s2.size()+1, 0)); // changing dimension as per need
for(int i=1; i
good stuff
Explained Like a Dopamine Hit!
Thanks learned new thing index shifting
Understood!!!
understood :)❤