class Solution {
public boolean validPalindrome(String s) {
int len = s.length();
int left = 0;
int right = len - 1;
while(left < right){
if(s.charAt(left) == s.charAt(right)){
left++;
right--;
}else{
return isHuiwen(s, left, right - 1) || isHuiwen(s, left + 1, right);
}
}
return true;
}
public boolean isHuiwen(String s, int left, int right){
for(;left < right; left++,right--){
if(s.charAt(left) != s.charAt(right)){
return false;
}
}
return true;
}
}