get the length of longest common subsequence

get the length of longest common subsequence