1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/最长回文子串 [longest-palindromic-substring].html

30 lines
688 B
HTML
Raw Normal View History

2022-03-27 20:56:26 +08:00
<p>给你一个字符串 <code>s</code>,找到 <code>s</code> 中最长的回文子串。</p>
2023-12-09 18:42:21 +08:00
<p>如果字符串的反序与原始字符串相同,则该字符串称为回文字符串。</p>
2022-03-27 20:56:26 +08:00
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>s = "babad"
<strong>输出:</strong>"bab"
<strong>解释:</strong>"aba" 同样是符合题意的答案。
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>s = "cbbd"
<strong>输出:</strong>"bb"
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= s.length &lt;= 1000</code></li>
<li><code>s</code> 仅由数字和英文字母组成</li>
</ul>