Dynamic Programming21 sections · 916 units
Open in Course

LeetCode 1143 Longest Common Subsequence - Problem Statement

LeetCode 1143

This is Longest Common Subsequence from LeetCode. Given two strings, find the length of their longest common subsequence. For "abcde" and "ace", the LCS (Longest Common Subsequence) is "ace" with length 3.

A common subsequence appears in both strings in the same order, but not necessarily contiguously. What decisions do you make at each position?