Longest Increasing Subsequence - Dynamic Programming - Leetcode 300

preview_player
Показать описание


0:00 - Read the problem
1:45 - Brute Force Solution
2:58 - DFS Solution
10:55 - Dynamic Programming Solution
15:35 - Coding Solution

leetcode 300

#LIS #subsequence #python

Disclosure: Some of the links above may be affiliate links, from which I may earn a small commission.
Рекомендации по теме
Комментарии
Автор

Will never forget my first day on the job where a customer requested a feature to find the longest increasing sub-sequence. A totally valid way to test someones competency as a developer

Herald
Автор

Please keep that tone and speed of voice. It really helps to "understand" the solution. All of us are here to "understand" the solution not just for a solution. You will do great my dude.

lugiadark
Автор

You sir. Are the savior. Your made it so simple - some times you make me guilty why I could not think of it. Keep them coming!

srinadhp
Автор

"I really doubt your interviewer is going to expect you to get this without a hint; if they do I'd just walk out of the room"

Probably worked great up until the layoffs 😥

djx
Автор

Thank you for letting us know when we should walk out of the room. And what difficulty to expect in the interview :)

jagrutitiwari
Автор

Thanks, great explanation as usual, who needs cracking the coding interview when this exists!

director
Автор

You're the best at actually explaining the reasoning behind these problems and all your views are so well deserved. I'm absolutely dreadful at these despite being a senior dev but you don't know how much your channel has helped, thank you!!!

Golipillas
Автор

This explanation went down so smooth -your voice was very easy to follow and your diagrams weren't sloppy and not complex to understand -this might be the cleanest solution I have seen for this problem for beginners to study!

DanhWasHere
Автор

Thank you for the clear explanation! For those wondering why going backwards in dynamic programming, you can actually solve this in forward dynamic programming, start from the beginning, too.

jerrybao
Автор

Your explanation is so great. The tone, voice, and the way you say are so clear. Thank you so much <3

quocnguyeninh
Автор

That was so simple and an epic explanation of how you can start thinking about approaching this problem.
Being a beginner at dp, your videos help me understand how to start approaching a problem :)
Thankyou!

anushkachakraborty
Автор

this is brilliant, I wonder who can think of this solution for the first time during the interview

sathyanarayanankulasekaran
Автор

thank you omgosh this really is the best explanation one can find for this question on youtube

redomify
Автор

Easily the best channel for leetcode solutions. So easy to understand and code is always clean and concise. Hats off to you, Neetcode!

thatguy
Автор

excellent! This taught be how to choose subarrays recursively, and then the problem is trivial. Thanks a bunch.

medievalogic
Автор

Clear explanation! I believe you are the rising star in solving leetcode problem.

alex-gzud
Автор

Superb Explanation.Anyone having doubt in leetcode can refer this channel.Excellent video bro.I was struggling for this problem you made it clear.Thank you.

BadriBlitz
Автор

Great demostration starting from brute force, work way up to memoization and then leads naturally to dp!!! So Nice and easy it becomes with your approach!
1 question though: Why work from end backwords? How did you get the instinct?Could you please share your thougghts?

juliahuanlingtong
Автор

Yeah, I agree that being expected to find the O(nlogn) solution is walkout tier. I came damn close to figuring it out: use an ordered set to keep track of the elements you've inserted so far so that you can easily find the greatest value that's smaller than or equal to your current one. From here, assuming nums[i] is not your maximum thus far, there are two ways, and figuring out either of them is easily upper Hard level: either you actually delete the value you've found (the fact that this works because it means you can just return the size of your set at the end is incredibly unintuitive), or you mess with the way you store everything in the set so that you can still retrieve the index of the value corresponding to your found value (which is awful to implement).

christendombaffler
Автор

"I'd just walk outta the room" you solve your own problem Mr interviewer LOL

akhtarzaman