LCS function

Algorithm for the Longest Common Subsequence Problem