LeetCode5. 最長迴文子串(Java)

題目: 給定一個字符串 s,找到 s 中最長的迴文子串。你可以假設 s 的最大長度爲 1000。 示例: 代碼: 解法一 class Solution { public String longestPalindrome(String s) { //截取出全部子串 int len = s.length(); for (int i = len; i > 0; i--) { for (
相關文章
相關標籤/搜索