1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48: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 Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个字符串 <code>s</code>,找到 <code>s</code> 中最长的回文子串。</p>
<p>如果字符串的反序与原始字符串相同,则该字符串称为回文字符串。</p>
<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>