The longest common subsequence (LCS) of two sequences is the longest sequence that appears in both, in order but not necessarily contiguously. It's how diff and git find what changed between two files.
Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.
Start 7-day free trial