Last updated 4 years ago
Was this helpful?
Find the longest common subsequence (LCS) among to array of numbers/characters.
Example:
a = "abcde", b = "acef" LCS = "ace"
The optimal solution is a DP solution with time complexity O(MN) and space complexity O(min(M, N)).
O(MN)
O(min(M, N))