Longest Common Subsequence - LeetCode 1143 - Python
ฝัง
- เผยแพร่เมื่อ 12 พ.ย. 2024
- Explaining how to solve Longest Common Subsequence in Python!
Code: github.com/dee...
@1:01 - Example + Explanation
@9:35 - Code
@11:38 - Time and Space Complexity
@12:03 - Code Walkthrough with Example
Music: Bensound
Lemme know if you have any comments or questions!:)))
** Forgot to mention it in the end of the video, but if we want to optimize this even further, we do better in space by only using 2 rows of our matrix. If you notice, we only ever need our own row and the one above us, so by overwriting values our space can be optimized to only be O(min(n,m))!
If you found this helpful, check out my channel for even **MORE VIDEOS**!!:)) www.youtube.co...
Give it a shot yourself - leetcode.com/p...
Excellent explanation of logic dry run of code deepti mam. Understood clearly mam.
You made my day with your video !
Can you make a video on this question "148. Sort List" of LeetCode as most of it's O(n) solutions are hard. While others are just converting the LinkedList to Arr and then sorting the LL. Please check
I’m so sapio over you