class Solution {
public:
bool isPalindrome(string s) {
if (s.empty()) {
return true;
}
string s2="";
int size = s.length();
for (int i = 0; i < size; i++) {
if (isalpha(s[i]) || isdigit(s[i])) {
s2.push_back(tolower(s[i]));
}
}
for (int i = 0; i < s2.length()/2; i++) {
if (s2[i] != s2[s2.length() - 1 -i]) {
return false;
}
}
return true;
}
};