PRINT Longest common subsequence

got 1 wrong out of 2 test case please help

hey @sibyt911, you are using wrong logic to print the sequence, dp table is OK. use below logic to print LCS.

int i = m, j = n;
while (i > 0 && j > 0)
{
if (X[i-1] == Y[j-1])
{
lcs[index-1] = X[i-1];
i–; j–; index–;
}
else if (L[i-1][j] > L[i][j-1])
i–;
else
j–;
}