A simple c++ solution using c++ library


#1

int Solution::isPalindrome(string A) {
transform(A.begin(), A.end(), A.begin(), ::tolower);
int i=0,j=A.length()-1;
while(i<=j)
{
if(!isalnum(A[i]))
{i++;
continue;
}
if(!isalnum(A[j]))
{j–;
continue;
}
if(A[i]!=A[j])
return 0;
i++;
j–;
}
return 1;
}