Total Accepted: 68173
Total Submissions: 309046
Difficulty: Easy
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a palindrome.
Note:
Have you consider that the string might be empty? This is a good question to ask during an interview.
For the purpose of this problem, we define empty string as valid palindrome.
该题主要是理解问题是什么。所谓的回串就是这个串的第一个和最后一个相等,第二个和倒数第二个相等.......当然,不区分大小写,如果是非数字非字母则跳过。
本文介绍了一个简单的算法问题:如何判断一个字符串是否为回文。主要考虑了只包含字母和数字的字符,并忽略大小写差异。文章还讨论了特殊情况,如空字符串也被认为是有效的回文。
1846

被折叠的 条评论
为什么被折叠?



