Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.
class Solution {
public String longestPalindrome(String s) {
int max_len = 0;
String max_str = null;
for(int i=0; i<s.length(); i++) {
for

在给定字符串S中,找出最长的回文子串。已知字符串S的最大长度为1000,并且存在一个唯一的最长回文子串。算法实现过程中遇到了超时问题。
订阅专栏 解锁全文
193

被折叠的 条评论
为什么被折叠?



