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))
1143. Longest Common Subsequence (Medium)arrow-up-right
Last updated 5 years ago