longest palindromic substring (n square)