mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 11:21:42 +08:00
add leetcode problem-cn part6
This commit is contained in:
30
算法题(国内版)/problem (Chinese)/验证回文串 [valid-palindrome].html
Normal file
30
算法题(国内版)/problem (Chinese)/验证回文串 [valid-palindrome].html
Normal file
@@ -0,0 +1,30 @@
|
||||
<p>给定一个字符串,验证它是否是回文串,只考虑字母和数字字符,可以忽略字母的大小写。</p>
|
||||
|
||||
<p><strong>说明:</strong>本题中,我们将空字符串定义为有效的回文串。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong> "A man, a plan, a canal: Panama"
|
||||
<strong>输出:</strong> true
|
||||
<strong>解释:</strong>"amanaplanacanalpanama" 是回文串
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong> "race a car"
|
||||
<strong>输出:</strong> false
|
||||
<strong>解释:</strong>"raceacar" 不是回文串
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= s.length <= 2 * 10<sup>5</sup></code></li>
|
||||
<li>字符串 <code>s</code> 由 ASCII 字符组成</li>
|
||||
</ul>
|
Reference in New Issue
Block a user