5. Longest Palindromic Substring
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000
问题描述
就是给你一个字符串,找出最长的回文子字符串。
解法1:
就是循环遍历,一个个比对,但是这个解法时间肯定最慢,时间复杂度要O(n^3)
解法2:

Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000
问题描述
就是给你一个字符串,找出最长的回文子字符串。
解法1:
就是循环遍历,一个个比对,但是这个解法时间肯定最慢,时间复杂度要O(n^3)
解法2:
本文标题:算法题目(JS)-5. Longest Palindromic
本文链接:https://www.haomeiwen.com/subject/wusfaxtx.html
网友评论