1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-04 06:51:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

存量题库数据更新

This commit is contained in:
2023-12-09 18:42:21 +08:00
parent a788808cd7
commit c198538f10
10843 changed files with 288489 additions and 248355 deletions

View File

@@ -1,30 +1,41 @@
<p>给定一个字符串,验证它是否是回文串,只考虑字母数字字符,可以忽略字母的大小写</p>
<p>如果在将所有大写字符转换为小写字符、并移除所有非字母数字字符之后,短语正着读和反着读都一样。则可以认为该短语是一个 <strong>回文串</strong> </p>
<p><strong>说明:</strong>本题中,我们将空字符串定义为有效的回文串</p>
<p>字母和数字都属于字母数字字符</p>
<p> </p>
<p>给你一个字符串 <code>s</code>,如果它是 <strong>回文串</strong> ,返回 <code>true</code><em> </em>;否则,返回<em> </em><code>false</code><em> </em></p>
<p><strong>示例 1:</strong></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong> "A man, a plan, a canal: Panama"
<strong>输出:</strong> true
<strong>解释:</strong>"amanaplanacanalpanama" 是回文串
<strong>输入:</strong> s = "A man, a plan, a canal: Panama"
<strong>输出</strong>true
<strong>解释:</strong>"amanaplanacanalpanama" 是回文串
</pre>
<p><strong>示例 2:</strong></p>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong> "race a car"
<strong>输出:</strong> false
<strong>解释:</strong>"raceacar" 不是回文串
<strong>输入</strong>s = "race a car"
<strong>输出</strong>false
<strong>解释:</strong>"raceacar" 不是回文串
</pre>
<p> </p>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>s = " "
<strong>输出:</strong>true
<strong>解释:</strong>在移除非字母数字字符之后s 是一个空字符串 "" 。
由于空字符串正着反着读都一样,所以是回文串。
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= s.length <= 2 * 10<sup>5</sup></code></li>
<li>字符串 <code>s</code> ASCII 字符组成</li>
<li><code>1 &lt;= s.length &lt;= 2 * 10<sup>5</sup></code></li>
<li><code>s</code> 仅由可打印的 ASCII 字符组成</li>
</ul>