Longest Common Subsequence - LeetCode 1143 - Python #dynamicprogramming #leetcode #blind75

preview_player
Показать описание
Explaining how to solve Longest Common Subsequence in Python!

@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))!

Рекомендации по теме
Комментарии
Автор

Excellent explanation of logic dry run of code deepti mam. Understood clearly mam.

harshav
Автор

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

Musaafir-lnfeet