LCS working but not getting the right value - LCS : long commun subsequence