Longest Common Subsequence Problem In Python