动态规划最长回文子串

func longestPalindrome(s string) string {
    if s == ""{
        return ""
    }
    slen := len(s)
    //初始化对角线
    var arr =  make([][]int,slen)
    for i:=0;imaxlen {
               maxlen = j-i+1
               maxstr = s[i:j+1]
           }
       }
    }
    return maxstr;
}

你可能感兴趣的:(动态规划最长回文子串)