【问题描写叙述】
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.
1.【基础知识】
回文字符串是一个正读和反读都一样的字符串,比方“level”或者“noon”等等就是回文串。
2.【屌丝代码】
class Solution { public: bool isPalindrome(string s) { int m(0); char a[100]={'0'}; if(s.size()==0) return true; for(int k =0;k<s.length();k++) { if((s[k]<='z'&&s[k]>='a')||(s[k]>='A'&&s[k]<='Z')) a[m++] = s[k]; } a[m] = '