← Playground/

LCS Algorithm

?Longest Common Subsequence — finds the longest sequence appearing in both strings in the same order.

The Longest Common Subsequence (LCS) problem finds the longest sequence of characters common to two strings, preserving order but not contiguity. Solved with bottom-up DP in O(m×n) time.

Message me on WhatsApp