Please point out the error.Can become the easiest solution in O(n) time O(1) space


#1
int Solution::isPalindrome(string A) {
    int l=0,r=A.size()-1;
    transform(A.begin(), A.end(), A.begin(), ::tolower); 
    while(l<=r)
    {
        while(l<=r&& A[l]<'a' && A[l]<'0' && A[l]>'9' && A[l]>'z')
            l++;
        while(l<=r&& A[r]<'a' && A[r]<'0' && A[r]>'9' && A[r]>'z')
            r--;
        if(A[l]!=A[r]) return 0;
        else l++,r--;
    }
    return 1;
}