add the solution of longest palindrome problem in leetcode and refactor code