Uncrossed Lines | Dynamic programming | Leetcode

  Рет қаралды 20,528

Techdose

Techdose

Күн бұрын

Пікірлер: 161
@ashutoshaswal
@ashutoshaswal 4 жыл бұрын
The problem is same as Longest Common Subsequence. And great explanation Sir!
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@mrinalraj7166
@mrinalraj7166 4 жыл бұрын
The concept explained here cannot be found anywhere on the KZbin. It's just priceless.
@techdose4u
@techdose4u 4 жыл бұрын
Thanks 😅
@amansarma417
@amansarma417 4 жыл бұрын
And that too for free ❤
@ayushgarg5929
@ayushgarg5929 4 жыл бұрын
Sir , the chronology of your teachings style is just awesome
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@ajithpalani5139
@ajithpalani5139 4 жыл бұрын
Great teachers are in youtube,useless teachers are in my university.thank you tech dose for this wonderful video🔥.God bless you⚡⚡⚡
@techdose4u
@techdose4u 4 жыл бұрын
Thanks 😅
@shresthmishra9329
@shresthmishra9329 4 жыл бұрын
I've grown to be a fan of your vedio.They're my first stop for any question or concept I need to clarify on programming!
@techdose4u
@techdose4u 4 жыл бұрын
👍
@starc701
@starc701 4 жыл бұрын
after some time this channel will be the gold for people.. Thanku very much bro ...explained very fluently.
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@weixia
@weixia 4 жыл бұрын
well explained, thanks Tech Dose.
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@ShubhamMahawar_Dancer_Actor
@ShubhamMahawar_Dancer_Actor 4 жыл бұрын
Question formatted so differently ,it simply asking fin dthe length of maximum subsequence of 2 list.BTW WELL EXPLAINED.
@techdose4u
@techdose4u 4 жыл бұрын
Yes true :)
@spetsnaz_2
@spetsnaz_2 4 жыл бұрын
took me 3hrs to finally get to the solution
@yitingg7942
@yitingg7942 3 жыл бұрын
Yeah!!! I solved this one bug free without watching this video. 😎 Now I am going to relax and watch this video lol.
@techdose4u
@techdose4u 3 жыл бұрын
Great 😀
@AmanKumar-ht8xi
@AmanKumar-ht8xi 4 жыл бұрын
Very well explained .. There will be a day when your channel will have almost all the important questions asked in interview.. and a large number of follower ..Keep working bro.. God bless..😃
@techdose4u
@techdose4u 4 жыл бұрын
Thanks bro :)
@MrAditya2rock
@MrAditya2rock 4 жыл бұрын
Thank you so much for the video. It might take one some practice to intuitionalize but the concept is well explained.
@techdose4u
@techdose4u 4 жыл бұрын
Yes correct :)
@AmanKumar-ht8xi
@AmanKumar-ht8xi 4 жыл бұрын
If you ever get time please come live bro.. we love to watch you and your awesome suggestions..
@techdose4u
@techdose4u 4 жыл бұрын
It's difficult since I am making videos everyday 😅 I will come live later when I get time.
@100bands
@100bands 4 жыл бұрын
Your explanation makes so much sense. Thank you
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@setYourHandleHttp404
@setYourHandleHttp404 4 жыл бұрын
I watched almost all of your videos. Nice explanations! Thanks!!
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@prabhujoseph4121
@prabhujoseph4121 2 жыл бұрын
Great Video. This looks same as Longest Common Subsequence.
@techdose4u
@techdose4u 2 жыл бұрын
Yep :)
@JP-uv2nh
@JP-uv2nh 4 жыл бұрын
Clearly explained. Good job. I think default values in a vector is '0'. So, I guess we can directly start from '1' in both loop variables.
@techdose4u
@techdose4u 4 жыл бұрын
Nice suggestion. I never checked for default value. If it is true then it will make things easier.
@avgerageCSStudent
@avgerageCSStudent 4 жыл бұрын
I think this problem is very similar to 1143. Longest Common Subsequence : leetcode.com/problems/longest-common-subsequence/
@Aree.TiwariJii
@Aree.TiwariJii 3 жыл бұрын
Much better than apna college.
@hemanthn436
@hemanthn436 4 жыл бұрын
Superb explaination sir We expect more content from you
@techdose4u
@techdose4u 4 жыл бұрын
👍
@sunnysam69
@sunnysam69 4 жыл бұрын
Very well explained! Find it very tough to crack DP problem s
@vikrantrajan8707
@vikrantrajan8707 2 жыл бұрын
Thank you for making this video. This is gold!
@satyajitdas2780
@satyajitdas2780 4 жыл бұрын
Thanks. Bro. Excellent explanation. Along with code.
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@NikhilKumar-oy7mx
@NikhilKumar-oy7mx 4 жыл бұрын
I am really bad at dp. but you explain it really nice. BTW your channel has grown a lot, congratulations. The channel was quite new when i joined. Great job.
@techdose4u
@techdose4u 4 жыл бұрын
Practice will improve you in everything (including dp). I hope we keep growing our community :)
@mrinalraj7166
@mrinalraj7166 4 жыл бұрын
You are amazing!!!! Thanks for making these videos.
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@amishbhat3560
@amishbhat3560 4 жыл бұрын
Thank You So much.Very well explained.
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@rajathnayak5624
@rajathnayak5624 4 жыл бұрын
similar to longest subsequence in 2 strings nice explanation thank you sir
@techdose4u
@techdose4u 4 жыл бұрын
Yes....welcome :)
@Cube2deth
@Cube2deth 4 жыл бұрын
@@techdose4u How is it different from LCS? it looks exactly the same
@techdose4u
@techdose4u 4 жыл бұрын
Both are same.
@ujjwalmaheshwari2327
@ujjwalmaheshwari2327 Жыл бұрын
awesome explaination
@techdose4u
@techdose4u Жыл бұрын
Welcome :)
@harshpatel1385
@harshpatel1385 4 жыл бұрын
Great explanation. Keep uploading video
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@vaibhavpareek5571
@vaibhavpareek5571 4 жыл бұрын
Very well explained....
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@vishnuvardhan-md1ux
@vishnuvardhan-md1ux 4 жыл бұрын
I applied longest increasing subsequence technique dp[i] = max(dp[i],dp[j]+1) for all j < i and (j & i) are non intersecting. bool isnotIntersecting(pair& curr_pair,pair& prev_pair) { if((curr_pair.first>prev_pair.first) && (curr_pair.second>prev_pair.second)) { return true; } return false; } int maxUncrossedLines(vector& A, vector& B) { vector pairs; unordered_map um; for(int i=0;i
@vishnuvardhan-md1ux
@vishnuvardhan-md1ux 4 жыл бұрын
Can you add a video of the dice roll simulation problem in leetcode?
@ESudarshan
@ESudarshan 4 жыл бұрын
thank you! It would be of great help if you could share the recursive solution as well.
@techdose4u
@techdose4u 4 жыл бұрын
I deleted it 😅 The recursion solution is same as Longest Common Subsequence. Please follow that.
@yashpreetbathla4653
@yashpreetbathla4653 4 жыл бұрын
Wow man such an amazing video WOW
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@yashpreetbathla4653
@yashpreetbathla4653 4 жыл бұрын
@@techdose4u you the bestttt always!!
@techdose4u
@techdose4u 4 жыл бұрын
😅
@ArifulIslam-im7wr
@ArifulIslam-im7wr 4 жыл бұрын
Thank you so much...sir
@techdose4u
@techdose4u 4 жыл бұрын
Welcome
@teddylun
@teddylun 4 жыл бұрын
Very clear explanation :)
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@mohitshoww
@mohitshoww 4 жыл бұрын
Same as Lcs
@techdose4u
@techdose4u 4 жыл бұрын
Yes.
@ayushisharma1381
@ayushisharma1381 4 жыл бұрын
Thanks sir... For making these videos.. Helps a lot :)
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :3
@mukulpanchakarla8944
@mukulpanchakarla8944 4 жыл бұрын
Subscribed!!!!!
@techdose4u
@techdose4u 4 жыл бұрын
👍
@kunalkheeva
@kunalkheeva Жыл бұрын
Thank you!
@techdose4u
@techdose4u Жыл бұрын
Welcome :)
@amangupta9776
@amangupta9776 4 жыл бұрын
Always be great approach
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@dovyraj1272
@dovyraj1272 4 жыл бұрын
sir, is this equal to the max sub sequence problem ??
@kushgupta1187
@kushgupta1187 4 жыл бұрын
Well explained and covered everything. I need your help... Could you please help me from where I can learn dp.. I am lacking in it and usually i am not able to develop recursive equation to solve dp problem. Thanks in advance 😊
@techdose4u
@techdose4u 4 жыл бұрын
You can only do it with practice. Keep finding reasons for each steps followed in dp and keep practicing. It will be easier as time goes by.
@snehal462
@snehal462 4 жыл бұрын
Great explanation!
@dipanjanjayswal507
@dipanjanjayswal507 4 жыл бұрын
please make a clear video on *Generate all the binary strings of N bits* and how the code is working. Please 🙏
@shobhitkumar6820
@shobhitkumar6820 4 жыл бұрын
very well explained sir
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@anmolwadali9227
@anmolwadali9227 4 жыл бұрын
AWESOME explanation SIR
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@pabitrakb5291
@pabitrakb5291 Жыл бұрын
Wow explanation
@rohithkumartangudu4664
@rohithkumartangudu4664 4 жыл бұрын
How did u got which data structure should be used for this problem?? I tried using strings but it failed for so many testcases.
@techdose4u
@techdose4u 4 жыл бұрын
You could have used recursion or memoization or DP. But what technique did you use?
@rohithkumartangudu4664
@rohithkumartangudu4664 4 жыл бұрын
@@techdose4u I didn't got the idea to use recursion or DP. Firstly convert the two arrays into strings and after that take take one by one from first string and finding the index of that character In the second string. And then I used some conditions which are failing for some testcases. So I thought I did wrong in my approach.
@Shashank0002
@Shashank0002 3 жыл бұрын
Wow, I just realised that this question is another version of finding LCS.
@dhanashreegodase4445
@dhanashreegodase4445 3 жыл бұрын
Thank you so much
@amarnaath5673
@amarnaath5673 4 жыл бұрын
Please post a video Interview prep video GeeksforGeeks Vs Leetcode for preparation
@techdose4u
@techdose4u 4 жыл бұрын
Nice idea. I will do it :)
@hemanthn436
@hemanthn436 4 жыл бұрын
Explain backtracking problems also sir
@techdose4u
@techdose4u 4 жыл бұрын
I will try
@franksheng4173
@franksheng4173 4 жыл бұрын
great explanation.
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@AYUSHISHARMABIT
@AYUSHISHARMABIT 4 жыл бұрын
Heavy video ;)
@techdose4u
@techdose4u 4 жыл бұрын
😅
@bhuwansingh2534
@bhuwansingh2534 3 жыл бұрын
what's the point of configuring the std i/o streams if we're not doing any input or output operations?
@techdose4u
@techdose4u 3 жыл бұрын
Just a template repetition maybe
@pradeepkumar-xt5fl
@pradeepkumar-xt5fl 4 жыл бұрын
One problem with your playlist is it show several video of same topic or u have uploaded same video many time or it just bug?
@techdose4u
@techdose4u 4 жыл бұрын
KZbin bug.
@prernachauhan6262
@prernachauhan6262 4 жыл бұрын
This is basically longest common subsequence!
@techdose4u
@techdose4u 4 жыл бұрын
Yes correct :)
@m00oon
@m00oon 4 жыл бұрын
sir basically we have to find longest common subsequence
@techdose4u
@techdose4u 4 жыл бұрын
Yes right.
@amirjutt0
@amirjutt0 Жыл бұрын
sir , I think there is a mistake in this question . The answer for 2 3 2 and 2 in the cell [3][1] should be 2 but it is one. In my opinion , the correct formula for case where character matches is max(left cell , upper cell) + 1.
@shivasaini4097
@shivasaini4097 3 жыл бұрын
@techdose4u
@techdose4u 3 жыл бұрын
❤️
@zyro9922
@zyro9922 3 жыл бұрын
Wow
@techdose4u
@techdose4u 3 жыл бұрын
:)
@wewe-fx6un
@wewe-fx6un 4 жыл бұрын
It's LCS.
@techdose4u
@techdose4u 4 жыл бұрын
Yes, correct.
@nikhilkumar-ot9rn
@nikhilkumar-ot9rn 4 жыл бұрын
this is exactly LCS could have directly told that
@techdose4u
@techdose4u 4 жыл бұрын
It wouldn't have mattered. People who don't actually fully understand concept of LCS could not have solved it. So, telling them it is LCS will never clear the concept. You knew because you understood LCS preety well I suppose.
@nikhilkumar-ot9rn
@nikhilkumar-ot9rn 4 жыл бұрын
@@techdose4u ok... btw very nice explanation
@animatedzombie64
@animatedzombie64 3 жыл бұрын
getting this intuition is tough, how do you get it. just blown up my brain
@ravilamkoti5081
@ravilamkoti5081 4 жыл бұрын
Is it similar to LCS ?
@techdose4u
@techdose4u 4 жыл бұрын
Same as LCS
@shaziasamreen8584
@shaziasamreen8584 4 жыл бұрын
How do we get method of using dp?
@techdose4u
@techdose4u 4 жыл бұрын
Ummm....if you think about an easy approach then you will solve it using recursion. If you have solved enough DP problems then you must have come across LCS or similar problems. This one is very similar as well. You need practice to be able to solve DP. Don't worry. Keep practicing.
@akshbansal7715
@akshbansal7715 4 жыл бұрын
Which college are you from?
@techdose4u
@techdose4u 4 жыл бұрын
Please check linkedIn
@harshdevrandhawa8355
@harshdevrandhawa8355 4 жыл бұрын
Longest common subsequence problem also has the same solution
@techdose4u
@techdose4u 4 жыл бұрын
This is a different way of putting the same question :)
@dayanandraut5660
@dayanandraut5660 3 жыл бұрын
this is a variation/application of LCS problem
@aviraltiwari9963
@aviraltiwari9963 4 жыл бұрын
Sir what if ex is 2 4 4 1 3 4 It should give 2 but i did dry run and got 1 . Pls crrct me.
@techdose4u
@techdose4u 4 жыл бұрын
It will be one because only 1 element in list 2 and 1 are common. Watch the video carefully. I have explained the cases for intersection. You must be matching 2 4s of list 1 with one 4 of list 2. This is wrong.
@aviraltiwari9963
@aviraltiwari9963 4 жыл бұрын
@@techdose4u okk sir.. Thank u very much!!
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@gauravkhurana420
@gauravkhurana420 4 жыл бұрын
Bhaiya count inversions kra do... BIT se
@techdose4u
@techdose4u 4 жыл бұрын
Let me first make BIT then I will do it's questions as well.
@garumugam4480
@garumugam4480 4 жыл бұрын
Not sure i got it or not as i find DP as one of toughest areas..😭
@techdose4u
@techdose4u 4 жыл бұрын
Needs practice man. You can do it.
@buckbd187
@buckbd187 4 жыл бұрын
how not crossing line property is being maintained in dp solution. we did not did any think to keep the not crossing property or did we do something? would u plz make me understand how not crossing property is maintained ?
@manthankhorwal1477
@manthankhorwal1477 4 жыл бұрын
Is today's video is late or you have already done it ?
@techdose4u
@techdose4u 4 жыл бұрын
It's late because video was based on graph algorithm and it takes long time to think, explain and edit. Now it's done :) Videos might get late occasionally. Up untill now, questions were easy.
@manthankhorwal1477
@manthankhorwal1477 4 жыл бұрын
@@techdose4u great video .. thankyou
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@topgeargaming8679
@topgeargaming8679 4 жыл бұрын
Which mic do u use bro ?
@techdose4u
@techdose4u 4 жыл бұрын
Boya
@adarshawasthi5449
@adarshawasthi5449 4 жыл бұрын
LCS problem languaged changed
@techdose4u
@techdose4u 4 жыл бұрын
Correct :)
@jaydeepmahajan6598
@jaydeepmahajan6598 4 жыл бұрын
After few days tech dose will give resignation letter to his employer because his youtube channel going to lots of subscribers and viewership 😂😂,paisa , paisa 😅
@techdose4u
@techdose4u 4 жыл бұрын
With support of our community, it might come true :)
@amanrai9880
@amanrai9880 4 жыл бұрын
This is absolutely similar to common substring
@techdose4u
@techdose4u 4 жыл бұрын
Yea....the famous LCS problem.
Longest Repeating Subsequence | Dynamic Programming | LCS
19:59
Uncrossed Lines - Leetcode 1035 - Python
29:14
NeetCodeIO
Рет қаралды 9 М.
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 119 МЛН
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,5 МЛН
Balloon burst problem dynamic programming | Leetcode #312
27:25
Minimum edit distance | Dynamic programming | Backtracking
28:52
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,2 МЛН
Maximal square | Dynamic programming | Leetcode #221
18:27
Techdose
Рет қаралды 72 М.
Uncrossed Lines Python - Leetcode 1035 | Algorithm Explained
19:19
Persistent Programmer
Рет қаралды 393
Best time to buy and sell stock with cooldown | Leetcode #309
34:31