for this problem , you just need to use two pointers to judge whether it is a palindrome.
but what we should consider is to delete the " " and such , . and other characters .
class Solution {
public:
bool isPalindrome(string s) {
if(s.empty())
return true;
string t = "";
for(int i = 0;i< s.length();i++)
{
if((s[i] >= 'A'&& s[i]<='Z')||(s[i] >= 'a' && s[i] <= 'z' )|| (s[i] >='0'&&s[i] <='9'))
if(s[i] >= 'A' && s[i] <= 'Z')
t+= s[i]-'A'+'a';
else
t+=s[i];
};
for(int i = 0;i<t.length();i++)
if(t[i] != t[t.length()-1-i])
return false;
return true;
}
};