class Solution {
public boolean isPalindrome(String s) {
if (s.isEmpty()) {
return true;
}
int s = 0, e = s.length() - 1;
char chars, chare;
while(s <= e) {
chars = s.charAt(s);
chare = s.charAt(e);
if (!Character.isLetterOrDigit(chars)) {
s++;
} else if(!Character.isLetterOrDigit(chare)) {
e--;
} else {
if (Character.toLowerCase(chars) != Character.toLowerCase(chare)) {
return false;
}
s++;
e--;
}
}
return true;
}
}