125. Valid Palindrome
题目大意
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers.
Given a string s
, return true
if it is a palindrome, or false
otherwise.
中文释义
如果一个短语在将所有大写字母转换为小写字母并去除所有非字母数字字符后,可以正读和反读都一样,那么它就是一个回文。字母数字字符包括字母和数字。
给定一个字符串 s
,如果它是一个回文,则返回 true
,否则返回 false
。
示例
Example 1:
Input: s = "A man, a plan, a canal: Panama"
Output: true
Explanation: "amanaplanacanalpanama"
is a palindrome.
Example 2:
Input: s = "race a car"
Output: false
Explanation: "raceacar"
is n