Longest Increasing Path in a Matrix (DFS + Memoization)

  Рет қаралды 19,269

AlgosWithMichael

AlgosWithMichael

Күн бұрын

Пікірлер: 102
@madhav3444
@madhav3444 3 жыл бұрын
I never comment on videos but bro you explained it beautifully. Love from India
@yolopassion
@yolopassion 3 жыл бұрын
You are most underrated on KZbin. Your explanations are crisp and to the point
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Thank you!
@sna241
@sna241 2 жыл бұрын
Crystal clear for dummies like me. Please keep making such videos when you have time. It will help a lot of us. I appreciate the effort into those animations - the best part. I will support on Patreon as soon as I pass the interview. I wish I have found this channel sooner.
@AlgosWithMichael
@AlgosWithMichael 2 жыл бұрын
Thank you! I hope you get your interviews passed!
@karthikkumaresan1091
@karthikkumaresan1091 3 жыл бұрын
Thanks my friend.. you are up there among those who make this world a better place.. Keep rocking!
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Haha wow thank you!
@NithinRajuChandy
@NithinRajuChandy 2 жыл бұрын
The way you articulate the solution, simply the best I’ve seen so far. Thank you!
@mahadevmane9375
@mahadevmane9375 2 жыл бұрын
I love the way you explain the problems as well as implement. Thank you very much.
@jrajesh11
@jrajesh11 7 ай бұрын
Man you are just awesome! Beautiful illustration . Thanks for the great work. Please keep more coming!
@AnkitSharma-dx5yy
@AnkitSharma-dx5yy 3 жыл бұрын
This guy is blessed with some extra ordinary skils. Thanks for the explanation
@audreychu1140
@audreychu1140 3 жыл бұрын
I've watched several videos solving this question, and I found yours is the most clear (to me, haha) one. Thank you for this great tutorial!
@kumarc4853
@kumarc4853 3 жыл бұрын
A big Thank you for helping me in my journey to getting offers from Google and Linkedin. Excellent content and explanations
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Glad to hear!! Congrats
@Alice-Tokio
@Alice-Tokio 3 жыл бұрын
Omg, you made it look like a very basic and easy problem, thank you!!
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Glad you liked it!
@imj3nny
@imj3nny 2 жыл бұрын
Thank you so much for making this video. After watching so many videos, your explanation drove it home for me!!
@AlgosWithMichael
@AlgosWithMichael 2 жыл бұрын
Glad it helped!
@jinny5025
@jinny5025 3 жыл бұрын
Your explanation is so clear that dummies like me also could understand. I just subscribed to your channel Thanks! :)
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Awesome, thank you!
@yuanyingli9069
@yuanyingli9069 2 жыл бұрын
please make more videos, you are the best! I love to use animated to explain the solution! it is so clear!
@AlgosWithMichael
@AlgosWithMichael 2 жыл бұрын
More to come!
@sunwoodad
@sunwoodad 4 жыл бұрын
Thank you Michael as always! Your explanation is most understandable.
@AlgosWithMichael
@AlgosWithMichael 4 жыл бұрын
Thank you Ethan!
@DED_Search
@DED_Search 3 жыл бұрын
Now I know how to explain DFS + MEMO. Thank you!
@AtriTripathi
@AtriTripathi 3 жыл бұрын
More such videos, please. We're all waiting.
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
More on the way
@perihanersoy6166
@perihanersoy6166 3 жыл бұрын
Thank you for the good explanation, the algorithm is also really clear and simple. I like it
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
You are welcome!
@sanjayizardar2263
@sanjayizardar2263 3 жыл бұрын
I always learn something new from your videos. Keep posting specially the hard ones.
@kunalkumar-ue3hm
@kunalkumar-ue3hm 3 жыл бұрын
What an explanation !!! So excited to explore all the videos. Keep rocking 💥
@KushalBhatia
@KushalBhatia 3 жыл бұрын
Very detailed and easy to follow when you explain. Great work. Thank you
@vikramshivaprakash3389
@vikramshivaprakash3389 3 жыл бұрын
Had the same problem today for Google phone interview 😬
@rtql8d
@rtql8d 3 жыл бұрын
Great solution, very understandable! I modified your solution slightly, instead of a matrix for my cache, I used a Map() and concatenated i + ',' + j to use as keys and max + 1 would be the values.
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Nice, that is a great way to do it
@stephanbranczyk8306
@stephanbranczyk8306 3 жыл бұрын
I love all your explanations! In many cases, they're some of the best. Just one quick question. What animation software/framework are you using to create these animations? Thank you.
@ajitbombe5168
@ajitbombe5168 3 жыл бұрын
Thanks Michael... I've completed your full playlist on graph. waiting for more such playlist. ;)
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Awesome, thank you for watching!
@parthgupta3799
@parthgupta3799 3 жыл бұрын
Your videos are so helpful sir. Thank you so much! I really like the way you explain the problems and then code them very easily.
@shivamshuklasvlog627
@shivamshuklasvlog627 2 жыл бұрын
please make more and more videos .. we need your explanation seriously bro.
@AlgosWithMichael
@AlgosWithMichael 2 жыл бұрын
A lot more videos on the way
@kumarc4853
@kumarc4853 3 жыл бұрын
Mike you always have the biggest Mic :p And also the best explanations.
@Live-hh6li
@Live-hh6li 3 жыл бұрын
Thanks bro I coded myself because your explanation was awesome 😎
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
That is awesome!!
@petchaCoding
@petchaCoding 3 жыл бұрын
ur explanation is helping a lot, I'm wondering why am I being request to know it to get a internship
@aminesfahani3563
@aminesfahani3563 3 жыл бұрын
many thanks a 2d array as cache for memoization is very efficient
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Yep it is. This way of using memoization can be applied to many problems as well
@harshbhardwaj3594
@harshbhardwaj3594 3 жыл бұрын
amazing explanation!
@prajwalbhusari8299
@prajwalbhusari8299 3 жыл бұрын
wow man need more videos like this
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
More on the way!
@shitijarora5712
@shitijarora5712 3 жыл бұрын
Bestest video on this topic!
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Glad it was helpful!
@innerchoir6690
@innerchoir6690 2 жыл бұрын
This is amazing instruction. Thank you.
@jantejones5441
@jantejones5441 3 жыл бұрын
Excellent video! Keeup up the good work!
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Thank you very much!
@mohdekrama8597
@mohdekrama8597 3 жыл бұрын
amazing explaination!! but wen u used n for rows and m for cols.. 😑 😛
@DSCuber
@DSCuber 2 жыл бұрын
Great solution! How would you modify this to account for diagonal movement?
@sitronco
@sitronco 4 жыл бұрын
Fantastic explanation
@AlgosWithMichael
@AlgosWithMichael 4 жыл бұрын
Thank you!
@neozoan
@neozoan 3 жыл бұрын
Nicely done. Thank you.
@HornOKPlease
@HornOKPlease 2 жыл бұрын
I love your channel so muchhhhhhhhh
@shreejitnair2174
@shreejitnair2174 4 жыл бұрын
Brilliant please do more hard problems
@AlgosWithMichael
@AlgosWithMichael 4 жыл бұрын
Definitely!
@yuansha9999
@yuansha9999 2 жыл бұрын
The best explantions
@codemonkey2614
@codemonkey2614 2 жыл бұрын
Excellent explanation. Thank you so much! One quick question. When calculating the current position, would it be better if we store all longestIncreasingPath of four directions to cache? Looks like the code only stores the longest increasing path of the four directions + 1 to cache.
@mariyadilip595
@mariyadilip595 3 жыл бұрын
Excellent bruh !!❤️
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Thank you!
@劉力仁-i1d
@劉力仁-i1d 3 жыл бұрын
so clear!
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Awesome!
@DED_Search
@DED_Search 3 жыл бұрын
Could you please kindly explain why in the worst case, we visit each cell two times? Scratching my head. Thanks.
@275phuongvy
@275phuongvy 3 жыл бұрын
nice video animation and explanation. Thank you
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Thank you!
@sumishajmani705
@sumishajmani705 2 жыл бұрын
Though I don't know Java much, I use Python but isn't defining the same-named private and public functions an issue? I know it's not because the code is working .. lol .. but how?
@codedoctor3265
@codedoctor3265 3 жыл бұрын
Wow , Loved your explanation :) . More Videos on FAANG !!!!
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
More to come!
@mrmcyx8283
@mrmcyx8283 2 жыл бұрын
Beautiful day again. ; )
@pranjalbansal8459
@pranjalbansal8459 3 жыл бұрын
please anyone tell me why we are using DFS but not BFS.
@afayes
@afayes 11 ай бұрын
Is there a link to the code?
@parulagrawal635
@parulagrawal635 3 жыл бұрын
Can you explain the time complexity for recursive solution ? I believe it is 3^(mn) , can you confirm it
@solarkenny
@solarkenny 3 жыл бұрын
Michael explained that it was O(m*n) at 18:00. Due to memoization, you visit each node once.
@taloto07
@taloto07 3 жыл бұрын
without memoization, I believe it's 4^(m*n). because in worst case scenario, you have four choices to make.
@tathagatnegi5923
@tathagatnegi5923 3 жыл бұрын
Thanks 👍
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
No problem 👍
@abuyahyadiab363
@abuyahyadiab363 4 жыл бұрын
I don't watch the video yet but I'm sure that the video will be helpful
@abuyahyadiab363
@abuyahyadiab363 4 жыл бұрын
Plz keep going
@AlgosWithMichael
@AlgosWithMichael 4 жыл бұрын
Thank you, I hope you enjoy it!
@AlgosWithMichael
@AlgosWithMichael 4 жыл бұрын
Yep, more to come!
@codingessential91
@codingessential91 3 жыл бұрын
really loved the explanation man. just a suggestion, you could do away with background animations on slides. it's a bit distracting. the explanation and ur voice over are more than enough
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
That is really good feedback, thank you
@TheShamstabrez11
@TheShamstabrez11 3 жыл бұрын
it is failing for me for this input [[7,8,9],[9,7,6],[7,2,3]]. output should be 6 but it gives 4
@bliewhale
@bliewhale 3 жыл бұрын
It is giving 6 with the code .
@arjay_2002
@arjay_2002 3 жыл бұрын
awesome
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Thanks!
@ashishjkumar4790
@ashishjkumar4790 3 жыл бұрын
I have no idea why interviewers ask such questions. I see absolutely no application/actual use of such problem statements/solutions. Longest increasing path in a tree/graph makes more sense, but Matrix!
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
Haha yea it is pretty ridiculous
@theanikaanisha4414
@theanikaanisha4414 3 жыл бұрын
This code has an infinite loop. We need to track the visited cells and only get into the recursive calls if the cell is not visited.
@KartikChugh
@KartikChugh 3 жыл бұрын
Nope because the flow is one way (from low to high)
@mateoaguirre1352
@mateoaguirre1352 2 жыл бұрын
ME ACABA DE SALVAR EL CULO
@willturner3440
@willturner3440 3 жыл бұрын
Getting tle even after 32ms runtime
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
rip
@RupinderSingh-gs8hz
@RupinderSingh-gs8hz 3 жыл бұрын
Also upload leetcode daily question solution
@AlgosWithMichael
@AlgosWithMichael 3 жыл бұрын
These videos take about 10-15 hours start to finish to make, there is no way lol
Google Coding Question - Making a Large Island (Hard)
25:11
AlgosWithMichael
Рет қаралды 16 М.
Kadane's Algorithm - Maximum Subarray (Dynamic Programming)
8:24
AlgosWithMichael
Рет қаралды 26 М.
Молодой боец приземлил легенду!
01:02
МИНУС БАЛЛ
Рет қаралды 1,9 МЛН
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2 МЛН
Longest Increasing Path in a Matrix - Leetcode 329
17:45
NeetCode
Рет қаралды 65 М.
Decode String | FAANG Coding Question | Stack
17:03
AlgosWithMichael
Рет қаралды 11 М.
Longest Path in a matrix  || GeeksforGeeks || Problem of the Day
14:28
TechWithSaumya
Рет қаралды 2,4 М.
Coding Interview Prep | 3 MUST KNOW Graph Problem Tips
13:27
AlgosWithMichael
Рет қаралды 18 М.
The OTHER AI Alignment Problem: Mesa-Optimizers and Inner Alignment
23:24
Robert Miles AI Safety
Рет қаралды 233 М.
Time Based Key Value Store | Netflix Coding Question | Binary Search
14:21
Leetcode 329. Hard || Longest Increasing Path in a Matrix
20:56
Code with Alisha
Рет қаралды 7 М.
Complete Dynamic Programming Practice - Noob to Expert | Topic Stream 1
3:50:43
Молодой боец приземлил легенду!
01:02
МИНУС БАЛЛ
Рет қаралды 1,9 МЛН