01What a subsequence is
A subsequence is what is left after deleting some elements of a sequence while keeping the rest in their original order. The sequence itself counts as its own subsequence too.
Formally, Z = ⟨z₁, z₂, …, z_k⟩ is a subsequence of X = ⟨x₁, x₂, …, x_n⟩ if there is a strictly increasing sequence of indices i₁ < i₂ < … < i_k such that z_j = x_{i_j} for every j = 1, …, k.
The lecture’s example: Z = ⟨B, C, D, B⟩ is a subsequence of X = ⟨A, B, C, B, D, A, B⟩ with index sequence ⟨2, 3, 5, 7⟩.
Do not confuse it with a substring, which must be contiguous. “BCD” is not a substring of ABCBDAB (the B in between breaks it), but it is a subsequence. That freedom to skip is exactly what makes the problem interesting.