solve the Longest Palindromic Substring