I am trying to find longest common sequence for these two strings
The common sequence is
NHA of length 3
But when I am trying to find out this through LCS matrix which I learnt from this link https://en.wikipedia.org/wiki/Longest_common_subsequence_problem
Based on the explanation and this example given there
I built this matrix for my case
But my matrix is reaching to the length 6 while it should reach to length 3 only because that is the longest comment sequence of the two strings I am using.
Could anybody please point out the mistake I am doing? I can see the problem is happening because of the extra 3 A's at the end of one of the string.