def longestPalindrome_TLE(self, s):
        length = len(s)
        dp = [[False for _ in xrange(length+1)] for _ in xrange(length+1)]
        for i in xrange(length+1):
            dp[i][i] = True

        longest = [0, 0]
        for j in xrange(length+1):
            for i in xrange(j-1, -1, -1):
                if i+1 == j:
                    dp[i][j] = True
                else:
                    dp[i][j] = s[i] == s[j-1] and dp[i+1][j-1]  # pre-access? starting backward

                if dp[i][j] == True and longest[1]-longest[0] < j-i:
                    longest[0], longest[1] = i, j

        return s[longest[0]:longest[1]]
Set text wrapping mode. Supported modes depend on text layout
dataset/ETHPy150Open algorhythms/LeetCode/005 Longest Palindromic Substring.py/Solution.longestPalindrome_TLE--crossover with--dataset/ETHPy150Open AnyMesh/anyMesh-Python/example/urwid/widget.py/Text.set_wrap_mode