Longest Common Subsequence Leetcode Python Pandas