Longest Increasing Subsequence - Dynamic Programming - Leetcode 300

  Рет қаралды 386,510

NeetCode

NeetCode

Күн бұрын

Пікірлер: 331
@NeetCode
@NeetCode 3 жыл бұрын
🚀 neetcode.io/ - A better way to prepare for Coding Interviews
@Herald50
@Herald50 2 жыл бұрын
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
@btKaranDhar
@btKaranDhar 2 жыл бұрын
Your sarcasam is depressive and hence ironic
@kotb2000
@kotb2000 2 жыл бұрын
It is important to understand the idea of subsequences, use memory efficiently and understand complexities of exponentially increasing subroutines. A good Programmer is not the one who solves it the first time seeing it. A good Programmer is the one who understands all the dimensions of the problem and Learn as much as he can about underlying intuitions. and remember when Tony Hoare first made Quick Sort He didn't say I am not going to face a situation where I sort a customer's Needs. His attitude as any computer scientist when making a helpful research or an idea was If I am able to think How to sort and even invent a sorting algorithm then I am going to be able to satisfy my Customer needs who were Future Generations that used Quick sort in every Customer related Situation . Good bye.
@francisconovoa6493
@francisconovoa6493 2 жыл бұрын
@@kotb2000 gg
@zweitekonto9654
@zweitekonto9654 2 жыл бұрын
Which interviewer hurt you bro
@VibeBlind
@VibeBlind 2 жыл бұрын
@@zweitekonto9654 All of them
@lugiadark21
@lugiadark21 3 жыл бұрын
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.
@shubhamsinghrawat6928
@shubhamsinghrawat6928 2 жыл бұрын
This how you except a google engineer
@AnupBhatt
@AnupBhatt 9 ай бұрын
You can change the playback speed on KZbin to make it go faster or slower. In case you find a problem that some other youtuber has solved, that Neetcode hasnt solved yet, use that feature.
@dj1984x
@dj1984x Жыл бұрын
"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 😥
@MaxFung
@MaxFung 8 ай бұрын
yep, now it feels like every other interview problem has been next level. still some easies out there though :(
@srinadhp
@srinadhp 3 жыл бұрын
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!
@jayman1ism
@jayman1ism Ай бұрын
why? he is just taking what he learned and regurgitated it to you. He didn't come up with this solution on his own just like you didn't.
@jagrutitiwari2551
@jagrutitiwari2551 Жыл бұрын
Thank you for letting us know when we should walk out of the room. And what difficulty to expect in the interview :)
@jerrybao1934
@jerrybao1934 Жыл бұрын
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.
@director8656
@director8656 3 жыл бұрын
Thanks, great explanation as usual, who needs cracking the coding interview when this exists!
@Golipillas
@Golipillas 3 ай бұрын
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!!!
@DanhWasHere
@DanhWasHere 3 жыл бұрын
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!
@sathyanarayanankulasekaran5928
@sathyanarayanankulasekaran5928 3 жыл бұрын
this is brilliant, I wonder who can think of this solution for the first time during the interview
@goshikvia
@goshikvia 3 жыл бұрын
Optimal Approach O(nlogn) bisect_left is a python function which gives the lower bound of the element in O(logn) time. bisect_left(array, element, start, end) class Solution: def lengthOfLIS(self, arr: List[int]) -> int: subs = [arr[0]] for i in range(1,len(arr)): if arr[i] > subs[-1]: subs.append(arr[i]) else: subs[bisect_left(subs, arr[i], 0, len(subs))] = arr[i] return len(subs)
@davidespinosa1910
@davidespinosa1910 2 жыл бұрын
So if arr = [1,3,4,2], then subs = [1,2,4] ? That's not a subsequence. And yet it works. The mystery deepens... :-)
@paulancajima
@paulancajima 2 жыл бұрын
@@davidespinosa1910 Yeah, the problem asks for the longest increasing subsequence. So, this will still give you the correct length just not the subsequence itself
@anushkachakraborty8635
@anushkachakraborty8635 2 жыл бұрын
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!
@The6thProgrammer
@The6thProgrammer Жыл бұрын
Not sure why, but this one felt much easier than the prior 3-4 problems in the Neetcode Dynamic Programming learning path. Got it on my first try, and solved it exactly the way Neet did. Just goes to show the value of the Neetcode Roadmap, and how the patterns start to solidify in your mind over time.
@engineersoftware4327
@engineersoftware4327 11 ай бұрын
That's correct, I feel the same way
@rajatsrivastava555
@rajatsrivastava555 Жыл бұрын
Thanks for the explanation @neetcode , code in java : class Solution { public int lengthOfLIS(int[] nums) { int dp[] = new int[nums.length]; Arrays.fill(dp, 1); for (int i = nums.length - 1; i >= 0; i--) { for (int j = i-1; j >=0; j--) { if (nums[i] > nums[j]) { dp[j] = Math.max(dp[j], 1 + dp[i]); } } } int maxLIS = 0; for (int i = 0; i < nums.length; i++) { maxLIS = Math.max(maxLIS, dp[i]); } return maxLIS; } }
@quocnguyeninh32
@quocnguyeninh32 3 жыл бұрын
Your explanation is so great. The tone, voice, and the way you say are so clear. Thank you so much
@medievalogic
@medievalogic 3 жыл бұрын
excellent! This taught be how to choose subarrays recursively, and then the problem is trivial. Thanks a bunch.
@alex-gz7ud
@alex-gz7ud 3 жыл бұрын
Clear explanation! I believe you are the rising star in solving leetcode problem.
@NeetCode
@NeetCode 3 жыл бұрын
haha, thanks I appreciate the kind words
@thatguy14713
@thatguy14713 2 жыл бұрын
Easily the best channel for leetcode solutions. So easy to understand and code is always clean and concise. Hats off to you, Neetcode!
@gritcrit4385
@gritcrit4385 5 ай бұрын
DFS: O(2^n) DP: O(n^2) Binary search: O(n logn)
@christendombaffler
@christendombaffler Жыл бұрын
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).
@SunsetofMana
@SunsetofMana 6 ай бұрын
Why would deleting the value you found work? If you have input array [2,3,1,5,6] you cannot delete the value found at 5 when you see the 1, because then you cannot use it for the actual longest subsequence of 2,3,5,6 Tbh the approach of using a heap to store the subsequence length cache is quite reasonable imo… it’s annoying to implement but quite straightforward as an obvious improvement. If you know how to solve heap problems, which are based on the premise that a heap is a priority queue, why not just apply that here when you are searching for the largest element?
@gabrielfonseca1642
@gabrielfonseca1642 Ай бұрын
@@SunsetofMana Not sure a heap would work, you mean for when you check the max right? You still have to know if nums[i] is less than the value, it's not enough to find the largest subsequence. In that case, it's still O(n^2).
@yhbarve
@yhbarve 29 күн бұрын
I kinda had half of the intuition but you cemented it for me. Simply lovely as usual!
@pujasonawane
@pujasonawane 3 жыл бұрын
I got it crystal clear now. You explained it very well. Thanks a lot.
@redomify
@redomify 3 жыл бұрын
thank you omgosh this really is the best explanation one can find for this question on youtube
@MerlynJohnson
@MerlynJohnson 3 жыл бұрын
whether it should be if nums[i] < nums[j] or if nums[j] < nums[i]
@username-zs6dv
@username-zs6dv Жыл бұрын
noticing the subproblem 'is there an increasing subsequence with length m' is O(n), and m is between 1 and n, we can use binary search and get overall complexity O(nlogn). But it is way neater with DP
@juliahuanlingtong6757
@juliahuanlingtong6757 3 жыл бұрын
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?
@NeetCode
@NeetCode 3 жыл бұрын
I'm used to working from the end backwards because it's similar to the recursive approach. But it's possible and maybe more intuitive to start at the beginning. Whatever makes sense for you is the best approach I think.
@eltonlobo8697
@eltonlobo8697 3 жыл бұрын
Example: [1,4,2,3], While computing longest common subsequence starting from index 0, the number at index 2, will be used. While computing longest common subsequence starting from index 1, the number at index 2 will be used. What i mean by "Will be used" is i am asking a question: What is the longest common subsequence starting from index 2. So if we had started computing longest common subsquence from backwards, then when we compute longest common subsquence for index 0 and 1, we already have the answer for longest common subsequence starting from index 2 stored.
@thetrends5670
@thetrends5670 2 жыл бұрын
🎵 this is two, and this is two, so it doesn't really matter, which one we do. 🎵 Music by Neetcode at 13:34
@alivation3409
@alivation3409 Ай бұрын
Dynamic programming hurts my brain, but this and a few other videos are helping me out. Thanks muchly!
@BadriBlitz
@BadriBlitz 3 жыл бұрын
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.
@testbot6899
@testbot6899 2 жыл бұрын
O(nlogn) solution class Solution: def lis(self, A): res = [A[0]] n = len(A) for num in A[1:]: if num>res[-1]: res.append(num) else: res[bisect_left(res,num)] = num return len(res)
@ildar5184
@ildar5184 11 ай бұрын
No need to complicate it further by doing reverse looping, from 0 to n works just fine with the same function of max(lis[i], 1+lis[j]) for i=0 to n, j=0 to i if nums[j]
@RajasekharReddi
@RajasekharReddi 8 ай бұрын
Excellent oration of the logic and the ending is at another level.
@paul90317
@paul90317 Жыл бұрын
even if it's not the best solution, it's the best tutorial for LIS I've ever seen
@hwang1607
@hwang1607 8 ай бұрын
leetcode editorial suggests improving time complexity with binary search class Solution: def lengthOfLIS(self, nums: List[int]) -> int: sub = [] for num in nums: i = bisect_left(sub, num) # If num is greater than any element in sub if i == len(sub): sub.append(num) # Otherwise, replace the first element in sub greater than or equal to num else: sub[i] = num return len(sub)
@robyc9545
@robyc9545 2 жыл бұрын
It is interesting that you calculated DP from right to left. I think it also works if you do from left to right.
@briankarcher8338
@briankarcher8338 Жыл бұрын
Yes it works both directions.
@kevinkkirimii
@kevinkkirimii Жыл бұрын
@@briankarcher8338 i thought so.
@kineticsquared
@kineticsquared 10 ай бұрын
Wow, what a great explanation! Thank you for the detailed step-by-step example.
@numberonep5404
@numberonep5404 2 жыл бұрын
Great explanation as usual!! A repost(?) of the O(nlong(n)) solution, not that hard and really comes in handy for other problems :) class Solution: def lengthOfLIS(self, nums: List[int]) -> int: indices = [None for _ in range(len(nums)+1)] # Mapping of size to the last indice of the subsequence size = 0 def binary(elem, l, r): # a binary search is possible since the sizes are sorted by definition, even if the values in nums are not while l
@winterheat
@winterheat Жыл бұрын
11:34 I think using the name LIS[ ] is not a good choice, as you may think the final solution is LIS[0] this way. The strict definition of this lookup table, let's call it lookup[ ] is this: IF YOU TAKE THAT NUMBER nums[i] into the sequence, then what is the longest you can get. So lookup[i] IS IF YOU MUST INCLUDE nums[i] into that sequence. If you write LIS[i], it sounds like it is the max NO MATTER you include nums[i] or not, which is not the case. So that's why in the code that follows, the final result is not LIS[0], but max(LIS)
@RishinderRana
@RishinderRana 9 ай бұрын
Agreeing with everything except the walking out part :)
@TheDeepsz
@TheDeepsz 3 жыл бұрын
Thanks for such a great explanation, I searched for it so many places, but I didn't find anything more than the formula. This video should have more likes.
@amitupadhyay6511
@amitupadhyay6511 2 жыл бұрын
I came for that nlogn solution. But again, thanks for the tremendous help as usual
@akhtarzaman2189
@akhtarzaman2189 2 жыл бұрын
"I'd just walk outta the room" you solve your own problem Mr interviewer LOL
@huseyinbarin1653
@huseyinbarin1653 2 жыл бұрын
DP always surprises me. What a good approach. Thank you
@harishsn4866
@harishsn4866 2 жыл бұрын
since we have already assigned LIS with value 1 for the length of nums, in the first for loop, we can start from len(nums) - 2 instead of len(nums) -1.
@jan0195
@jan0195 2 күн бұрын
Bravo ! 👏 You need an standing ovation.
@NhanSleeptight
@NhanSleeptight 2 жыл бұрын
do you mind sharing the code for the DFS solution? I just want to practice implementing these ideas.
@DavidDLee
@DavidDLee Жыл бұрын
def lengthOfLIS2(self, nums: List[int]) -> int: L = len(nums) cache = {L: 0} def dfs(i): if i in cache: return cache[i] n = nums[i] result = 1 for j in range(i + 1, L): if n < nums[j]: result = max(dfs(j) + 1, result) cache[i] = result return result return dfs(0)
@dominikilja
@dominikilja 2 жыл бұрын
This was a great explanation! I struggled with this, but I'm happy to learn some new techniques!
@sachin_yt
@sachin_yt 3 жыл бұрын
One of the best solutions ever. thank you.
@killerthoughts6150
@killerthoughts6150 3 жыл бұрын
it would be great to see the n log n approach
@eduardoignacioroblessosa6349
@eduardoignacioroblessosa6349 9 ай бұрын
was looking for this comment
@rrt19254
@rrt19254 3 ай бұрын
Oof this is the first DP Problem I solved on my own! Was so happy that mine looked a lot like yours.
@sameerprajapati8978
@sameerprajapati8978 2 ай бұрын
I got asked to optimize the current dp solution in less than o(n^2)
@asdfasyakitori8514
@asdfasyakitori8514 Жыл бұрын
Man 8 lines of code is all it takes, grate solution
@ece-a036nischintasharma5
@ece-a036nischintasharma5 Жыл бұрын
Was unable to wrap my head around this one. Your explanation was so nice!!
@HC-xh6mh
@HC-xh6mh 3 жыл бұрын
The best explanation video I have watched so far!
@sdsunjay
@sdsunjay 8 ай бұрын
It feels overly complicated to start from the end of `nums` when we can start from the beginning. The implementation below was *easier* to understand conceptually and ran faster. ``` class Solution: def lengthOfLIS(self, nums: List[int]) -> int: LIS = [1] * len(nums) for i in range(1, len(nums)): sub_problems = [LIS[k] for k in range(i) if nums[k] < nums[i]] LIS[i] = 1 + max(sub_problems, default=0) return max(LIS) ```
@vietnguyenquoc4948
@vietnguyenquoc4948 8 ай бұрын
IDK why but your voice in this video sounds really calming
@vivekjoshi9073
@vivekjoshi9073 2 жыл бұрын
Thank you sir best explanation able to do in other programming language easily and concept is clear
@ajithkumarspartan
@ajithkumarspartan 6 ай бұрын
When i feel its so hard to learn DSA problem and crack FAANG like companies my mind tells me "neetcode" and after seeing the video explanation i become calm and motivated to proceed further.
@annabellesun4719
@annabellesun4719 2 жыл бұрын
another day watching neetcode to help me with leetcode. Thank you!
@danielmdubois
@danielmdubois Жыл бұрын
Great video, much appreciated. However, I didn't understand the logical jump at @10:40 that suggested we were "starting at 3". I would have preferred to see a solution that proceeded front-to-back, because it seemed to me that is what you were doing in the recursive solution.
@RolopIsHere
@RolopIsHere 15 күн бұрын
how times has changed... competition is so fierce now that people expect you to get the binary search right out of the bat... go this question at Meta interview, the interviewer wanted the binary search solution.
@thetechies2259
@thetechies2259 Жыл бұрын
last statement : 'walk out of the room' really made me laugh😂😂.. that's the attitude
@premraja55
@premraja55 3 жыл бұрын
It’s looks easier after your explanation 👏🏻
@NeetCode
@NeetCode 3 жыл бұрын
Glad it was helpful!
@yahwehagape
@yahwehagape 3 жыл бұрын
Great explanation. Curious about nlogn solution now.
@NeetCode
@NeetCode 3 жыл бұрын
Thanks!
@Sandeepkumar-uv3rp
@Sandeepkumar-uv3rp 3 жыл бұрын
Really very helpful, explained in a crystal clear manner👌👌
@toastedregret1601
@toastedregret1601 Ай бұрын
What's the point of the max()? Since we're checking that the subsequence is valid already, wouldn't it always resolve to 1 + dp[i]?
@NickDrian
@NickDrian 2 жыл бұрын
No need to iterate through backwards, forwards works just as well.
@bennypham4337
@bennypham4337 3 жыл бұрын
Really helped me out to understand this question!
@NeetCode
@NeetCode 3 жыл бұрын
Thanks, I'm glad it was helpful!
@kexinliu6105
@kexinliu6105 Жыл бұрын
It does not really make sense when there's an array [9,2,5,3,7] and LIS[0] returns a 1. Doesn't LIS[0] mean the LIS starts from index 0 to len(num) and it should return 3 which is 2,3,7 or 2,5,7
@anandkrishnan72
@anandkrishnan72 2 жыл бұрын
"I really doubt your interviewer is gonna expect you to get the O(n logn) solution without a hint. If they do, I would personally just walk out of the room." XDDDDD
@noorbasha8725
@noorbasha8725 Жыл бұрын
This happen with me yesterday, he didnt given any hint, result is i failed the interview
@alfamatter12
@alfamatter12 Жыл бұрын
That sarcasm at the end made me laugh like hell😂😂😂! I'm also walking out from this problem
@nightmarauder2909
@nightmarauder2909 2 жыл бұрын
lol you kept typing LIST great explanation, thanks!
@Cld136
@Cld136 3 жыл бұрын
Thank you very easy to understand and follow. I had problem understanding the solution on leetcode :)
@entropy7571
@entropy7571 3 жыл бұрын
Make a video about the binary search solution to this problem
@realoctavian
@realoctavian Жыл бұрын
finally a good explanation and solution for this, thanks!
@thecomputerman1
@thecomputerman1 2 жыл бұрын
You are solving problems like God would solve, I attempted it and couldn't solve it in my first attempt though I knew what Dynamic programming is. Also, the way you explain choices and recursion is far the best way to start attacking problems like this.
@themathguy314
@themathguy314 Ай бұрын
"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" LMAO!
@aquere
@aquere 2 жыл бұрын
Brute Force DFS's time complexity is not 2^n. We have a branching factor of n at worst, not 2. So it's gonna be n^n
@diksha8347
@diksha8347 2 жыл бұрын
This explaination is so so good. Thank you.
@serdardalgic6397
@serdardalgic6397 8 ай бұрын
There is an alternative O(nlogn) (?) solution using the bisect module of python. I found this solution more intuitive and faster than the solution in this video, that's why I wanted to share here. For anyone who wants to debug/understand the algorithm, just uncomment the print line and check the output. sub = [] for num in nums: i = bisect_left(sub, num) # print(f'i: {i}, num: {num}, sub: {sub}') # If num is greater than any element in sub if i == len(sub): sub.append(num) # Otherwise, replace the first element in sub greater than or equal to num else: sub[i] = num return len(sub)
@handuongdinh9290
@handuongdinh9290 3 жыл бұрын
The video made it very easy to understand. Thank you for making this video. Keep up the work. I’m looking forward to view yours next videos.
@bohuai4021
@bohuai4021 Жыл бұрын
In the DP solution, why LIS[1] = max(1, 1 + LIS[2], 1 + LIS[3]) instead of max(1, 1 + LIS[2]) ?
@draugno7
@draugno7 Ай бұрын
Haha, after the last sentence I looked at the problem now on Leetcode and sadly read: Follow up: Can you come up with an algorithm that runs in O(n log(n)) time complexity? :D
@roxanamoghbel9147
@roxanamoghbel9147 3 жыл бұрын
you're dynamic programming videos are all so well explained and helpful
@mikemartin6748
@mikemartin6748 3 жыл бұрын
Why do you not cover the best solution: dynamic programming with binary search? That's the one I'm looking for because you need it to solve later problems like the Russian Doll Envelopes.
@CostaKazistov
@CostaKazistov 2 жыл бұрын
AlgoExpert covers it
@adipandhare4061
@adipandhare4061 2 жыл бұрын
What if the sequence is: A = [1, 4, 2, 8, 5, 7, 3]. If we start from the back end, it's very focused on the last element. Almost like it's a greedy algorithm and would not reach the optimum result. So how would this algorithm work in this scenario?
@apoorvdp
@apoorvdp 2 жыл бұрын
@Neetcode the O(N^2) solution now gives a TLE on Leetcode. Given the popularity of this problem, could you please make a follow-up video or respond to this comment on how to get to the O(N.logN) solution?
@De1n1ol
@De1n1ol 2 жыл бұрын
for me top-down didn't give TLE, the bottom-up did. I use python
@peter0702
@peter0702 10 ай бұрын
It will not in c++, but I guess you can reference to this video kzbin.info/www/bejne/aGPWYquuh9usaJo you can see the problem is the O(nlogn) solution is not sth you can figure out but more like applying an algorithm.
@shuyangnie2446
@shuyangnie2446 9 ай бұрын
Had this problem for my CV interview. wasn't able to answer it. Here I am.
@ShivangiSingh-wc3gk
@ShivangiSingh-wc3gk 2 ай бұрын
I am going crazy here how is this different from doing recursion with memoization (because after the first few iterations most of them are already solved for)
@srikanthvimjam9753
@srikanthvimjam9753 3 жыл бұрын
Really nice explanation. Your video saved me lot of time.
@NeetCode
@NeetCode 3 жыл бұрын
Thanks!
@CuriousTogether
@CuriousTogether 2 жыл бұрын
Can't believe this can solve problem. Implemented in java
@LoganLi-su5ju
@LoganLi-su5ju Жыл бұрын
wow this time I code exactly the same as NeetCode except that I use 'dp' rather than 'LIS'
@ashwinjain5566
@ashwinjain5566 Жыл бұрын
can we do the opposite of what he did in the cached solution? basically looping FROM THE START of the array, and in the inner loop, work your way backwards (flipping the inequalities as required) till the 0th index? i tried this but apparently my solution isnt giving right answers: (in c++): vector dp(nums.size(),0); int max; for(int i=0; i=0; j--){ if(nums[j] < max){ max = nums[j]; ++dp[i]; } } } return *max_element(dp.begin(),dp.end()); cant seem to point out the error in logic
@dhanrajbhosale9313
@dhanrajbhosale9313 2 жыл бұрын
End was epic 😄.. "I'll probably walk out of interview"🙃
@protyaybanerjee5051
@protyaybanerjee5051 Жыл бұрын
"Personally, I would walk out of the room" - Yeah, man!
@ayush3032
@ayush3032 2 жыл бұрын
Please cover follow-ups also. BTW great explanation.
@rjlacanlaled9419
@rjlacanlaled9419 Жыл бұрын
Coding interviews should be 1 hour long. First 30 minutes, the interviewee asked the interviewer to solve a DSA medium/hard problem. If the interviewer finds the optimal answer within 30 minutes, we proceed to the next part where the interviewee finds the optimal solution for the interviewer's DSA problem. If the interviewer fails to answer, the interviewee proceeds to the next step of the recruitment process.
@bryenxie5765
@bryenxie5765 7 ай бұрын
i recently got this question as my interview question, the follow up was to return actual subsequence, can you help with that?
@sarvarjuraev1376
@sarvarjuraev1376 2 ай бұрын
Great explanation, thank you
Climbing Stairs - Dynamic Programming - Leetcode 70 - Python
18:08
Players vs Pitch 🤯
00:26
LE FOOT EN VIDÉO
Рет қаралды 133 МЛН
When u fight over the armrest
00:41
Adam W
Рет қаралды 31 МЛН
DP 43. Longest Increasing Subsequence | Binary Search | Intuition
16:27
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 577 М.
Coin Change - Dynamic Programming Bottom Up - Leetcode 322
19:23
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 245 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 197 М.
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,2 МЛН
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 147 М.
5 Simple Steps for Solving Dynamic Programming Problems
21:27
Reducible
Рет қаралды 1,1 МЛН
Players vs Pitch 🤯
00:26
LE FOOT EN VIDÉO
Рет қаралды 133 МЛН