Longest Increasing Subsequence (LeetCode 300) | Detailed solution with animations and diagrams
VloĆŸit
- Äas pĆidĂĄn 21. 07. 2024
- Actual problem on LeetCode: leetcode.com/problems/longest...
Chapters:
00:00 - Intro
01:19 - Problem Statement
05:27 - Brute Force & Recursion
09:25 - Dynamic Programming
19:11 - Dry-run of Code
22:03 - Finding the longest increasing subsequence
26:53 - Final Thoughts
đ Links to topics I talk about in the video:
Dynamic Programming Paradigm:
Recursion: âą Recursion paradigms wi...
Other problems on Dynamic Programming: âą Linked Lists
đ A text based explanation is available at: studyalgorithms.com
Code on Github: github.com/nikoo28/java-solut...
Test-cases on Github: github.com/nikoo28/java-solut...
đ Reference Books:
Starting Learn to Code: amzn.to/3sJm8Wl
Favorite book to understand algorithms: amzn.to/4848xJH
Favorite book for data structures: amzn.to/3P96YBv
Get started for interview preparation: amzn.to/44Nn5du
đ To see more videos like this, you can show your support on: www.buymeacoffee.com/studyalg...
đ„ My Recording Gear:
Recording Light: amzn.to/3PdsViT
Microphone: amzn.to/3Exv83x
Recording Camera: amzn.to/3PwyN8e
Tablet to sketch and draw: amzn.to/3ZdKVy7
Sketching Tool: amzn.to/45XJEgY
Laptop to edit videos: amzn.to/460ofDu
đ» Get Social đ»
Follow on Facebook at: / studyalgos
Subscribe to RSS feeds: studyalgorithms.com/feed/
Join fan mail: eepurl.com/g9Dadv
#leetcode #programming #interview
one of the underrated channels you got 1 more subscriber your explanations are very satisfactory
Welcome aboard!
When I'm not able to understand Neetcode solutions, I come to this channel. It feels like you take time to explain in detail and cover small details and use a lot of test cases. Using multiple test cases helps understand the problem better. I subscribed long back. keep up the good work.
what a great approach definitely everybody should watch i donot have words for your explanation just wow
I just wanna say thank you so much, you are the best programming instructor on youtube, no doubt!
i usually used to check videos with shortest time, but since I started watching your approaches I ended up looking if your videos are there for the questions on priority
loved the explanation, super easy you made it! thankyouuu!
Dry run part is the best , you are the only one doing this , I can finally connect the code with the logic. Thank you !!!!
so happy you feel that way
You made the problem seem so easy! Thank you!
Great video. Clearly understood
Really clear, keep up the good work!
You have explained it way better.
An Impressive Guidance to this problem...
Amazing brother I understand the problem and the solution too. THANKS TO YOU â€
Most welcome đ
Amazing explanation. Thank you for making this video
Thanks bro đ„đ„đ found out the best video after lots of searching
Your search ends here đ
Thank you man for this. Nice explanation
great video I like the step by step instructions
wow ...........great explanation :) thank u sir đ
I feel like my brain does push ups when i learn from you, thanks bro!
best explanation u make dp easy with ur explanation thanku
Hats off to you what an amazing explanation :)
Thanks a lot đ
i was able to figure out this solution myself ,đđđđ,,,just took a little help for code tho...thanks nikhil sir ur teaching is goated
WE WANT more series on dp .
Great Explanation!!
Glad it was helpful!
muahâŠ.muahâŠmuahâŠchummiâŠchummiâŠchummiâŠ.God bless u bhaiâŠtop notch teacherâŠ.
you are really awesome â€âđ„ thank you for Eever
You rock!
I find your videos very helpful in preparation for my upcoming interview
Best of luck!
How was your interview?
Sir you are awesome. Thank you for this video â€â€
Most welcome đ
tooooo awesome man
Hi Sir,
Eveytime I am searching for a leeetcode problem, I add your name in the suffix hoping you have done a video on it. I have understood each and every video that I have watched. Please do solve all the problems, that will be very helpful for people like me.
Shouldn't it be "return maxIndex + 1" ? Can you check ?
Which drawing app you use to write this all on iPad? and btw great explaination and please do not forgot to give answer
đ
that is GoodNotes 6.
Sorry, I have a quick question, What do you use to draw your diagramans?
That will be GoodNotes 6
can you tell me why did you avoid using index 2 while backtracking and finding the longest sequence elements 26:00
Did you follow the entire logic of the solution explanation or went straight to the code?
â@@nikoo28you mentioned to backtrack till zero but why u skipped only 2?
nice
@nikhil Could you please explain how this solution works? I found this on leet code
func lengthOfLIS(nums []int) int {
arr := make([]int, 0)
for _, num := range nums {
if len(arr) == 0 || arr[len(arr)-1] < num {
arr = append(arr, num)
continue
}
// binary search arr find minimum element greater or equal with num
l, r := 0, len(arr) - 1
for l
Have you tried using a debugger?
Dear Nikhil I love you so much! from Pakistan, I would love to know about you personally! like what actually you do?
A software developer.
bro please correct it O(n^2) is better than O(2^n) , that brute force is the better approach compared to recursion
Nikhil Lohia > Neetcode.
this solution isn't the most optimised one, atleast according to GFG. it's giving TLE, I really like how you explain, i would request you to make a new video with an accepted solution.
o