leetcode Valid Palindrome

来源:互联网 发布:网络运营商无服务 编辑:程序博客网 时间:2024/06/10 21:05

Valid Palindrome

My Submissions
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.


该题主要是理解问题是什么。所谓的回串就是这个串的第一个和最后一个相等,第二个和倒数第二个相等.......当然,不区分大小写,如果是非数字非字母则跳过。

0 0