#python3 classSolution: """ @param s: input string @return: a string as the longest palindromic substring """ deflongestPalindrome(self, s): # write your code here for length inrange(len(s),0,-1): for i inrange(len(s) - length + 1): l,r = i,i+length-1 while l < r and s[l] == s[r]: l+=1 r-=1 if l>=r: return s[i:i+length] return""