longestPalidrome use O(n^2) algorithm, LCS use Dynamic Programming algorithm O(n*m)