Question Id : 14983 |
Context : UGC NET Computer Science 26 June 2025 (Paper II)
The longest common subsequence of $\{1,2,3,2,4,1,2\}$ and $\{2,4,3,1,2,1\}$ is
🎥 Video solution / Text Solution of this question is given below:
Why: The LCS length for the two sequences is $4$.
$2,3,2,1$ is a subsequence of both:
$\{1,\underline{2},3,\underline{2},4,1,\underline{2}\}$ and $\{\underline{2},4,\underline{3},1,\underline{2},\underline{1}\}$.
Option (4) has length $5$ (too long), and (1), (2) are not subsequences of both.