For the complete documentation index, see llms.txt. This page is also available as Markdown.

Longest Common Subsequence

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)).

Problems

Last updated